1) Step 1: Make sure python is installed and working fine with following command:
$ python --version
2) Step 2: Create a folder to put your .py files
$ mkdir pythonDemo
3) Step 3: Craete a file with .py extension:
$ cd pythonDemo/
And add folloing lines to the file before saving:
print 'Hello Python !'
4) Step 4: Execute python script:
$ python hellpPython.py
You will following output on commmand line:
Hello Python !
In this article we have seen, how to create a python (.py) file and execute it on command line to print a simple string message. In upcoming articles we will see more complex usecases and tricks of python.