Your first python program
Subject: Python Programming
After installing the Python setup, to start the Python code editor IDLE:
1. Click the "start" button on your desktop environment and locate where your installed programs are list OR search to locate "Python IDLE"
2. Click the IDLE to start the Python shell environment that provides you with an environment to write some quick python code (note: when you code in shell you cannot save the program. So if you want to save your code as you are typically expected to do, then continue with step 3)
3. Click the "File" button in the opened Python shell environment and click "New" to open a new file.
4. Then write the line of python code:
print ("Hello Nigeria")
To save this new file as a Python file:
5. Click the "File" and "Save" from the menu of your new file.
6. When the "save as" dialogue windows come up, ensure you choose the location on your computer where you want the file to be saved (as a new python learner, please create a folder on your desktop environment to have all your python code) and enter the file name as hello.py (or whatever name you prefer but ensure you add .py to the end of the file name.
7. Click the "save" button to complete the saving of the file.
To run or execute the program:
Click the "Run" and "Module" from the menu bar and the output will be displayed on the Python shell environment.
Python IDLE shell environment
Newly opened file from the IDLE
Save Python file
By:
Benjamin Onuorah
Login to comment or ask question on this topic
Previous Topic Next Topic