Zum Inhalt springen

How to Install Python on Mac OS and How to Run Python code

techTFQ (11.01.2021)

 

How to install Python on Mac OS and How to write and execute or run your first Python program on Mac OS will be covered in this video.
We start by installing Python 3 and then go through 3 ways to write and execute Python program on Mac.

3 ways to write and execute Python program covered in this video are:

  1. Using IDLE, which is an IDE that comes along with Python installation.
  2. Using any text editor (in my case I use Atom) to write python program and then execute the program using Terminal window.
  3. By using Visual Studio Code (or simple VS Code), which is considered as one of the best IDE for Python.

Installing Python 3 on Mac can be confusing due to the existence of Python 2 which is preinstalled on all Mac OS. However, Python 2 and Python 3 can co-exist on the same machine hence we do not need to uninstall Python 2 before installing Python 3.

To Install Python 3, there are no prerequisites, and the installation is pretty straight forward.
To run your Python code may be confusing for beginners hence in this video we cover 3 different ways or 3 different editors which can be used to get started with writing and running python code.

When executing python code through IDLE, it’s essential to execute the RUN command from the text editor and then view the output in IDLE interpreter.
Whereas text editor does not have the functionality to run program by itself hence we use Terminal window to run the program.
Visual Studio Code (or simple VS Code) along with PyCharm, Jupiter Notebook and few others are considered as one of the best IDE for Python hence in this video we show how VS Code can be used to write and Run Python program.

The video is aimed at helping beginners to get started with installation of Python programming language on Mac and by showing multiple ways to start writing and executing Python code.

Reference Links:
Python Download:
https://www.python.org/downloads/

Visual Studio Code Download:
https://code.visualstudio.com/download

Atom Download:
https://atom.io/

Schlagwörter:

Schreiben Sie einen Kommentar

Ihre E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert