python learning

How to start coding with python

Python in Linux

Check version
python -V

How to use the python 3.5 version as default

rm /usr/bin/python
cd /usr/bin
ln -s python3.2 python

HOw to create list

chirag = []
chirag.append("he is a hero")
chirag[1]    #to see the attribute
chirag[0].upper()    #convert the attribute to the upper case

How write the script (chirag.py)

vi script.py

#!/usr/bin/env python
print “Hello Python”

#permission

chmod u+x hello.py

How to run the python scripts

./chirag.py
OR
python chirag.py

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.