Python is a programming language. You write code files, and then you can run the code files, and they'll do what you told them to do. This tutorial will teach you how to use python in a variety of situations. If this is your first programming language, hopefully this is a gateway to a new way of understanding the world!
- Other python tutorials drip feed you bits and pieces of python. We give you all the files you need, transparently.
- Other python tutorials run on web IDEs - ours is designed to run on your machine, so you're not left wondering how end to end python programs work.
- Other python tutorials split code and theory. We put the theory in the code, so you can see exactly what's going on.
There are two ways to approach this tutorial set. If you have time, we recommend installing python on your own computer - if you're really pressed for time, you can use an online interpeter.
- Go to the python website: https://www.python.org/downloads/
- Follow the python install instructions. If you are asked whether to "Add Python to PATH", press Yes or check the checkbox.
- Copy this set of code files, by pressing the green button on the upper right ("CODE") and download this code as a zip file. (Or, if you know how to use
git
, you can use that too.) - Download an editing tool e.g. visual studio code (https://code.visualstudio.com/). This will highlight the code and make it so much easier to read.
- Open each file with your editing tool (use
right click->open with
or otherwise). - Read each file and the included comments. When you're ready to run your program:
- [WINDOWS] Open a console window by pressing
shift+right click
in the file explorer where the code file is located. - Press
Open Powershell Window Here
- In the blue window that pops up, type in
python the_code_file.py
, then press enter.
- [WINDOWS] Open a console window by pressing
Alternatively, if you don't have much room on your computer, you can use an online python environment. We recommend https://repl.it/languages/python3. Then, instead of downloading the files here, you can open each file, copy the entire contents of the file into the window on the left, and press the run button when you're ready.
Alright, time to get started! You can get started from 1_helloworld.py
, or jump to any topic if you're already familiar with the basics.
If you have any edits to suggest, please raise an issue on github, or [email protected]
:)