Getting Started

Python is an object-oriented programming language ideally designed for rapid prototyping of complex applications. Like Perl, Python source code is also available under the GNU General Public License (GPL).

In this article we well see, how to create a python (.py) file and execute it on command line to print a simple string message.

1) Step 1: Make sure python is installed and working fine with following command:

$ python --version Python 2.7.6


2) Step 2: Create a folder to put your .py files

$ mkdir pythonDemo
$ cd pythonDemo/


3) Step 3: Craete a file with .py extension:

$vim hellpPython.py

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.
  • By Techburps.com
  • Sep 30, 2017
  • Python