Play Python intention ......

Learn n play with python as simple as it is .....
Lets keep everything in this blog simple and start python

Kick start Python

Since we all love open source we will start using Linux(Ubuntu)..
open terminal type "python" hit enter key....

if you get error then install python by executing "sudo apt-get install python"
tats all...

  1. "/usr/bin/python*" is the default path where is placed in Linux.
  2. "python -V" will prints you the version of python you have installed
  3.  " python -c ' print "verify command line execution" ' " to execute in command line.
  4.  "python File.py"  Executes File.py python code file.

There are lot of python IDE's available, follow the discussion on stackoverflow.com . I suggest to use "vi" editor until you feel tiered of typing syntax.

Here starts your PYTHON journey ... welcome to world of python

I am using python 2.7 there is python 3.0 available but i wont suggest to use 3.0 as of now(lot of modification in syntax between these two versions).

What you see is python interpreter, it's used to run small snippets of code or to clear doubts.....

Now type

Print "Hello Python"
Hello Python



Little important things about python

python is Dynamic and strongly typed language :  
  • No need to enter data type of variables you declare(Dynamic). 
  • Follows strict data type. Eg : you cannot concatenate string and integer. 
Time to play with python

>>> a = 10
>>> a
10
>>> b = -1
>>> a + b
9
>>> c = "string"
>>> c
'string'
>>> d = " another string"
>>> c + d
'string another string'
>>> 



Another Very important commans is "help"
How to use??  chekout

>>> help('print')
>>> help('float')
>>> help('if')
>>> help('while')


Hope you feel like wonder !!

we will stop scripting on command line n start write scripts using file with python extention ".py"

Use exit() or Ctrl-D (i.e. EOF) to exit python interpreter prompt...





Guys any thing IMPORTANT concepts about python interpreter please add a comment, I will update in this page. Thank you