Getting started with Python
I am using Mac with OS X Version 10.11.6
Python 2.7.x comes installed by default on Mac. But, it is recommended to install latest version.
Python 2.7.x comes installed by default on Mac. But, it is recommended to install latest version.
Check version of the Python installed:
Open Terminal and type python. then enter
This will give you the default version already installed.
In case you want to check if python3 version is installed, type "python3" at the command line.
Installation:
Download latest version (I got Python v3.6.3) of Python available from https://www.python.org/
As the download completes, installation wizard is triggered automatically; you just need to confirm the path and respond to the prompts.
As the download completes, installation wizard is triggered automatically; you just need to confirm the path and respond to the prompts.
Create a working folder on your system
Some Basics:
To execute Python code on Python 2.7.x, python command needs to be used as below in the terminal.
python samplecode.py
However, to execute tPython code on Python 3.x, use python3 command.
python3 samplecode.py
Comments
Post a Comment