- Operating System : Ubuntu 18
Note: By default most Ubuntu 18 system have Python installed.
01. Open a terminal window
02. Check if Python is already installed. Execute the following to determine.
$ python python3.7
A message will be shown if Python is available. In the following case, it is not yet installed.
03. Update the package list
$ sudo apt-get update
04. Wait for the operation to complete. Then run the command to install Python 3.7. This also works for lower version of Python 3 like 3.6.
$ sudo apt-get install python3.7 -y
05. Verify that Python is installed by accessing the Python shell.
06. Execute a Python application by checking the current time
from datetime import datetime datetime.now
07. You have now installed Python on your system.
Commands Mode Only
# At a CLI interface $ sudo apt-get update $ sudo apt-get install python 3.7 -y # Verify using Python Shell $ python3.7 from datetime import datetime datetime.now() exit()
Benefits of Python
- Easier syntax compared with other programming languages
- Less coding, less boiler-plate code, compared with other languages
- Readability, closer to pseudo-code
- Object-oriented programming, same concepts as other OOP languages