Python codes can be written
using IDLE interpreter.IDLE has a code editor window and a python shell.
Code Editor |
In
code Editor,python codes can be written and is saved with .py extension.Once
the code is written and saved we can run it by clicking on run module or F5.A
simple hello world program can be written in code editor window as
print
"HelloWorld!!"
save it as filename.py
and run it.Output is seen in the Python Shell as
>>Hello World!!
It
is possible to run commands directly in the python shell.The print "Hello
World!!" command in python shell gives exactly the same output as above.Python Shell |
In Python Shell,we can
assign values to variables,determine the values of variables and can also
use these variables in different modules.For Example:
>>a=5
>>a
5
>>dispvar(a)
value is 5
Also we can check the
output of the small portion of the main code in the Shell and hence making
debugging easier.
Comments
Post a Comment