This lesson walks through installing Python and running your first program. Replace this with your own content.
Installing Python
Download the installer from python.org/downloads and run it. On the first screen, tick Add python.exe to PATH.
Terminal window
brew install pythonTerminal window
sudo apt install python3Your first program
Create a file named main.py:
def main(): print("Hello, Python!")if __name__ == "__main__": main()Run it from the same folder:
Terminal window
python3 main.pyThe terminal prints Hello, Python!. On Windows, run py main.py instead.
Topics
- Installing Python
- Configuring your editor
- Running your first program