Tuesday, 14 October 2014

Run a python program

Assalamualaikum,

For this week classes, En.azrul have teach us how to run a python program.I have write and run a simple Python program using the IDLE editor in my computer using python version 2.7.8  as below.

Below are the  instructions :
1. Start IDLE . You will then see a window entitled "Python Shell" .

2.from the python shell window,select new window from the File menu

3.you will see a window entitled “Untitled”.

4.From a File Menu,select Save As,and select folder to save your Python program file.

5.Select your folder to save  your file in.

6.In the file name:Text Box type: test.py

7. Then click on the Save button. You will then see a blank editor window ready for you to type in your your Python program.

8.Type in the following text into this window
   print("Hello World")
 
 
9. To run this program, select Run Module from the Run menu.
   Then you will see your program running in a Python Shell window.


10. Close all Python windows to quit Python.
 
OR
 
 You can just start you program in Python shell.

 1. Start IDLE . You will then see a window entitled "Python Shell" . 
     Type in the following text into window Python Shell.
          print("Hello World")
 
 
2.Press Enter , Then you will see your program running in a Python Shell window.

 3. Close all Python windows to quit Python.
 
           Thank you.
 

 
 
 

 
 
 
 
 


No comments:

Post a Comment