Modes of Python Program

By |2019-04-14T20:34:21+05:30May 30th, 2017|Python|

In this tutorial, we will see the different ways to develop a python program/application are

Modes of Python Program :

We can develop a python program in 2 different styles.

  • Interactive Mode and
  • Batch Mode.

Interactive Mode :

Interactive mode is a command line shell. If we write a python program in the command line shell.

Typically the interactive mode is used to test the features of the python, or to run a smaller script that may not be reusable.

Example for Interactive Mode :

Open the command prompt, and go to the location which your python has been installed and hit the python command.

Python Program

On the above example, I have executed some arithmetic operations on the python command shell.

Batch Mode :

Batch mode is mainly used to develop business applications. In batch mode, we can write a group of python statements in any one of the following editors or IDEs

Editors :

  • Notepad
  • Notepad++
  • editPlus
  • nano
  • gedit
  • IDLE
  • Etc..

IDEs :

  • pycharm
  • Eric
  • Eclipse
  • Netbeans   Etc..

We can write our python programs any one of the above Editors/IDEs.

Example for Batch Mode:

demo.py

i=100
j=200
print i+j
print i-j
print i*j

After writing the above code on any favourite editor, save it with the extension of either .py or .pyw.

Then run the above python program by passing the below command on your terminal.

 

chandrashekhar@goka:~/Documents$ python demo.py
300
-100
20000

Happy Learning 🙂

About the Author:

Hi Folks, you have reach this so far, that shows you like what you are learning. Then why don't you support us to improve for bettor tutorials by leaving your valuable comments and why not you keep in touch with us for latest updates on your favorite blog @ facebook , twitter , Or Google+ ,

Leave A Comment