Friday, January 28, 2011

creating and running a python file

create a python file:

vi file_name.py

the extension of python file is .py
to check python libraries are installed on your system, type python in shell, this will shows the version and options in python.

example:
vi hello.py

the above command will create a python file with file name as hello.

running python scripts:

python file_name.py

the above command will run the python scripts.

example:

>vi hello.py
print("Hello world!")

>python hello.py
output:Hello world!

No comments:

Post a Comment