Wednesday, April 10, 2013

How To Run Python Program in Linux OS


How To Run Python Program in Linux OS

About Python:

Python is a programming language that lets you work more quickly and integrate your systems more effectively. You can learn to use Python and see almost immediate gains in productivity and lower maintenance costs.

Python runs on Windows, Linux/Unix, Mac OS X, and has been ported to the Java and .NET virtual machines.

Python is free to use, even for commercial products, because of its OSI-approved open source license.

New to Python or choosing between Python 2 and Python 3? Read Python 2 or Python 3.

Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Python’s elegant syntax and dynamic typing, together with its interpreted nature, make it an ideal language for scripting and rapid application development in many areas on most platforms.

The Python interpreter and the extensive standard library are freely available in source or binary form for all major platforms from the Python Web site, http://www.python.org/, and may be freely distributed. The same site also contains distributions of and pointers to many free third party Python modules, programs and tools, and additional documentation.

How To Run Python Program in Linux OS

Here i am posting how to run python Sample program in Linux os Like Fedora and Ubuntu etc..
 Hello World Python Program
Step 1:
$ vi PythonProgram.py
Next a Text Editor Window  will open in that add the sample code to execute the sample program in Python ...

Add in Text Editor :   print "Hello World"

Note that the ‘print’ in python does not require parenthesis.
Now run the above python program on Linux command line in the following Steps :
Step 2:
$ python PythonProgram.py
After Execute the above step you will get the output in the command line 

Step 3:
OUTPUT or Result For Above program:
Hello World

So we saw that the single ‘print’ statement executed and the string “Hello World” was displayed in output.
that sol to execute the python program in Linux Command ....

Happy Coding in Python Enjoy....

Click Here To Learn Python program Language 


No comments:

Post a Comment

Linux Tips and tricks,Online Linux Helpers