Running Python program can be done by following any of three methods.
1. Interactive Interpreter
2. Script from the Command Line
3. Integrated Development Environment ( IDLE )
(1) Interactive Interpreter :
In this method you can execute programs in interpreter with individual functions builtin python program.
(2) Script from the Command Line :
By using interpreter you can able to execute only one function at a time. If you wanna to execute multiple task, then go for script form. It is nothing but a writing all task in single file and running all task by executing that single file. Just follow the steps.
Step 1 : Open a text editor and type the program tasks. Save with .py extensiion. For example example.py
Step 2 : When you save your program then open terminal and execute program by " python filename.py "
In this example our filename is example. so run "python example.py" . Now you will get output like the below
(3) Integrated Development Environment :
IDLE is a very first UNIX IDE for Python. Instead of using python interpreter, we can able to perform same task in IDLE also. It's same like python interpreter step.
Step 1 : If you are not installed IDLE, install it by
Step 2 : Now Open IDLE. If you don't know how to open, just open terminal and simply type idle and press enter. Now you can see IDLE window.
Just start to work on it. Check the IDLE screenshot below.
If you have any queries, Post it in comments below. We will help you.
Thank you,
1. Interactive Interpreter
2. Script from the Command Line
3. Integrated Development Environment ( IDLE )
(1) Interactive Interpreter :
In this method you can execute programs in interpreter with individual functions builtin python program.
- Open Terminal and type python to open python interpreter.
- Now you can see your python interpreter. Just start to work with python by
(e.g)
print "Hello World ! "
print 1+1
(2) Script from the Command Line :
By using interpreter you can able to execute only one function at a time. If you wanna to execute multiple task, then go for script form. It is nothing but a writing all task in single file and running all task by executing that single file. Just follow the steps.
Step 1 : Open a text editor and type the program tasks. Save with .py extensiion. For example example.py
Step 2 : When you save your program then open terminal and execute program by " python filename.py "
In this example our filename is example. so run "python example.py" . Now you will get output like the below
(3) Integrated Development Environment :
IDLE is a very first UNIX IDE for Python. Instead of using python interpreter, we can able to perform same task in IDLE also. It's same like python interpreter step.
Step 1 : If you are not installed IDLE, install it by
sudo apt-get install idle
Step 2 : Now Open IDLE. If you don't know how to open, just open terminal and simply type idle and press enter. Now you can see IDLE window.
Just start to work on it. Check the IDLE screenshot below.
If you have any queries, Post it in comments below. We will help you.
Thank you,
Post a Comment