Skip to main content

Overview of Python

Python is an object oriented and  interpreted programming language, that is widely used in
  • scientific computing
  • web applications
  • general programming
Python runs on variety of platforms including Linux,Windows and
Mac and is free from hassles of commercial software licenses. Python is freely
available at www.python.org and offers the freedom to view and modify the
code. The chapter presents the basics of Python programming such as func-
tions, control statements, variable etc. The objectives of introducing Python
to the reader are
  •  to familiarize the reader with a general purpose object oriented program-ming language.
  •  to familiarize the reader with data visualization using Python. This will be
    useful when the reader works with tabular data in  many experiments
  • to initiate the reader with the manipulation of .csv files and spreadsheets using Python. This is essential since many instruments such as storage
    oscilloscopes, spectrum analyzers etc. output signals in these formats.

Installation of Python

The software development, using Python, requires three entities viz. 
  • Python interpreter
  •  text editor and
  •  terminal
the text editor is meant for inputting the Python source code that is to be
saved as a .py file. The terminal is where we invoke the Python interpreter
to run the source code. 

On Linux

Most major Linux distros come with the latest Python on it. If not, brave programmers can consider installing from the source code downloaded as a tarball from Python website. Or it is whole lot easier to install on Linux using a code repository. Linux, being a text based operatingt systems, it rich in text editors such as vi, nano, gedit, emacs, medit etc. A beginner can work happily with the gedit text editor.

The most useful feature of the Linux is the shell or its terminal emulator, by which many tasks such as sending/receiving mails, surfing the internet, file transfer etc. can be done even without a GUI.

On Windows

Latest version of Python interpreter (the current version in the 2.x series is
2.7.5 and that in the 3.x series is 3.3.2) can be downloaded from the above
website as a .exe file. It is wise to use the 2.x series rather than the 3.x series.
as many existing programs use 2.x version. Also it is easier to migrate to 3.x
from 2.x when all codes are in 3.x. Click it to run and install in the drive of your
choice. The installed interpreter can be accessed from the program menu to
launch the Python interpreter.

One may use the notepad or wordpad or the IDLE that comes shipped with
Python to edit the Python source file. Though there is no exact equivalent
of a Linux shell in Windows, the terminal that comes along with Python is
used as the command line interface to invoke the interpreter.

Comments