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 PythonSince 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"
- "/usr/bin/python*" is the default path where is placed in Linux.
- "python -V" will prints you the version of python you have installed
- " python -c ' print "verify command line execution" ' " to execute in command line.
- "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).
Print "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.
>>> a = 10
>>> b = -1
>>> a + b
>>> c = "string"
>>> d = " another string"
>>> c + d
'string another string'
Another Very important commans is "help"
How to use?? chekout
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