This is for the documents leaving history for studying python referred to the book called “Do it 점프 투 파이썬”
This post is a personal study note created while learning the topic discussed. Some information may be inaccurate or incomplete. If you notice any errors or have suggestions, I’d sincerely appreciate your feedback.
Python is an interpreted language that allows you to write simple code and see the results immediately, which makes it very convenient for quick testing and experimentation. However, we don’t always write simple code, when working with more complex or lengthy programs, the interactive shell (REPL) can become limiting.
In a REPL environment, each line of code is executed immediately after it's entered, which is helpful for quick tests but not ideal for developing multi-line programs. In such cases, using a code editor or an Integrated Development Environment (IDE) is much more suitable.
A code editor is a tool that helps you write and manage source code efficiently. When you install Python, it usually comes with a basic editor called IDLE (Integrated Development and Learning Environment), which is a good starting point for beginners.
Creating Python Programs Using the IDLE Editor
If you search for “IDLE” in the start menu search bar, a program like the one below should appear.
Click on it to launch the program.
Then, the IDLE shell will appear as shown below.
The IDLE shell is the window where the results of programs executed from the IDLE editor are displayed. Functionally, it is similar to the standard Python interpreter.
However, since the way indentation is displayed in the IDLE shell differs from that in a terminal-based Python shell, we will use the IDLE shell only for viewing program output during this lesson.
Therefore, examples that begin with the >>> prompt should be run in the standard Python shell (e.g., via the command prompt or terminal), not in the IDLE shell.
Now, let’s launch the IDLE editor. From the IDLE shell window, select [File → New File] from the menu.
A blank window will then appear; this is the IDLE editor where you can write your Python code.
Now, let’s write a Python program in the IDLE editor as shown below.
# hello.py
print("Hello World")
Python
복사
The first line, which begins with #, is a comment and does not affect the execution of the program at all. Comments are typically used to explain what the code does. In the example above, the name of the file containing the code is written in the comment.
Multiline comments should be written between three consecutive double quotation marks ("""). You can also use three single quotation marks (''') instead of double quotation marks.
"""
Author: DevChoi
Date: 7/19/2025
This program prints 'Hello World'
"""
Python
복사
Now let's run the program.
In the IDLE editor window, select [Run → Run Module] from the menu (shortcut key: F5).
When you run the program, a dialog box appears asking you to save the file first.
When you click OK, a window appears asking you to choose where to save the file. The author will create a folder named "python" under the C drive and save it there. You can choose any location you prefer.
The file extension must be .py.
Once the file is saved, the hello.py program runs. The result is displayed in the IDLE shell window as shown below.
Running a Python Program from the Command Prompt Window
This time, let's run the Python program (.py) directly from the CMD (Command Prompt).
If you search for "cmd" in the Windows search bar, you can find the Command Prompt program as shown in the image below. Go ahead and run the program.
When the CMD window opens, it will typically start in the C:\Users\user directory (the "user" part may vary depending on your computer). However, since the author saved the program in the python folder directly under the C drive, we need to navigate to that location.
cd stands for Change Directory, and it is a command used to move from your current location to a specific folder.
You simply type the path you want to move to after cd. For example, in Windows, cd \ means you want to move to the root directory of the current drive (e.g., C:\).
cd \
Bash
복사
After moving to the C drive using cd \, I navigated to the python folder by entering the cd python command.
Then, by entering the dir command in the python folder, you can see what files are inside that folder. Then you will be able to see hello.py file
At first, I thought dir was short for "directory," but I found out it actually stands for "display directory contents."
Then, by entering python hello.py, the Python file runs and you can see that "Hello World" is printed.
So far, we’ve looked at how to write and run Python code using IDLE and the Command Prompt. This works well for simple scripts, but it can be inefficient when working on large-scale programs. That’s why professional editors like VS Code or PyCharm are useful. We’ll go over how to install them later.