Python Programming Modes

By
There are two modes of python programs.
  1. Interactive Modes
  2. Script Modes
1.) Interactive Mode :- 
  • It is used for exploring Python syntax,seek help and debug short programs.
  • Interactive modes uses IDLE (Python Integrated development and Learning Environment).
  • It is available in windows after installation of python setup. Go Start Button--> Search IDLE --> open IDLE python--> It will be opened python shell prompt window-->You can run your python codes from here.
Now you can determine the version installed on your machine through python codes as given below:-
>>> import sys
>>> print(sys.version)
3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)]
>>> print("welcome to python shell prompt")
welcome to python shell prompt

Note:- You can see ,after the run the codes ,installed version of python is printed.In interactive mode of python programming python shell prompt will be used.

2.) Script mode :- 

  • It is used for writing full-fledged python programs.It is used to execute a python program in script mode.
  • Open Python IDLE --> Go to File--> create New File-->write your python codes in this file-->Save this python file -->Go Run --> Press Run Module (F5) -->After execute the script it will Show following output:-
ram.py file codes:-
import sys
print(sys.version)
print("Welcome to MNT LAB")
print("Welcome to http://www.msdotnet.co.in")

Output:-


Note:- You can run above python script on Net beans and Visual studio tools also. we will learn each concepts of python step by step.
Watch lecture 3 complete Video:-

0 comments:

Post a Comment

Powered by Blogger.