Monday, May 30, 2016

Python Notes

To find out where Python is installed in your Linux machine run the following commands:

~$ which python
/usr/bin/python

~$ which python3
/usr/bin/python3

To find out what Python version is running in your Linux box, run the following commands:

~$ python -V
Python 2.7.6

~$ python3 -V
Python 3.4.3

To start programing Python, run the following command:

~$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Use exit() or Ctrl-D (i.e. EOF) to exit
>>>

To exit type the following
>>> exit()
~$

~$ python3
Python 3.4.3 (default, Oct 14 2015, 20:28:29)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
~$