we help you to understand Python better

Prepare your Mac for the training

For this training, you need 3 things:

3things

1. Install Python 3

This course uses Python 3.

Download and install Python 3

downloadmac

2. Install a code editor

To write code, you need a code editor. For this course, I recommend Atom. Atom is a code editor that looks clean and is very responsive. It allows you to type code without distraction.

Download and install Atom

downloadmac

2.1 Create and save new python file

Start Atom and create a new file

Create a new python file

Save the file

Save python file

Save the file in the Documents folder and call it helloworld.py

Name python file

The name of a Python script always ends with .py

Type the following code:

code python file

The blue dot indicates that the file has changes.

Save the file.

3. Execute code

Launch the Terminal

code python file

The terminal starts in your home folder. You have saved helloworld.py in the Documents folder. To navigate to the Documents folder, enter the following command:

cd Documents

You are now ready to execute the code. Type the following command:

python3 helloworld.py

Output:

Hello World!

You have seen how to install Python, Atom and know how to execute your programs. Change the text Hello World! to something else. Save the code and run the 'python3 helloworld.py' command again to see the changes.

Dive deeper into this topic with training?
By using this site, you acknowledge that you have read and understand our Cookie and Privacy Policy.