Setup
Before we start writing Python code, we need to set up our development environment.
In this workshop, we will use PyCharm Community Edition, a free and beginner-friendly IDE.
Installing Python
First, download and install Python from the official website:
https://www.python.org/downloads/
During installation, make sure to check the option "Add Python to PATH".
This allows you to run Python from the terminal.
Verifying the installation
After installing Python, open a terminal and run:
python --version
If everything is set up correctly, you should see the installed Python version.
Installing PyCharm Community Edition
Download PyCharm Community Edition from:
https://www.jetbrains.com/pycharm/download/
Choose the Community version (not Professional), then follow the installation steps for your operating system.
Creating your first project
Open PyCharm and:
- Click "New Project"
- Choose a location for your project
- Make sure the Python interpreter is detected automatically
- Click "Create"
PyCharm will create the project structure for you.
Creating and running your first file
- Right-click inside the project panel
- Select "New" → "Python File"
- Name it
main
In the file, write:
print("Hello, world!")
To run the program:
- Right-click the file and select "Run 'main'"
- or click the green run button in the top-right corner
You should see the output in the terminal at the bottom of the screen.
- If Python is not detected automatically, you can select the interpreter manually from the project settings
- Do not worry if the interface feels unfamiliar at first; we will only use a few basic features during the workshop