Skip to main content

Introduction to the PyCharm IDE

What is an IDE?

Benefits of Using an IDE

Creating Your First Project in PyCharm

When you first use PyCharm you'll be greeted by its startup screen.

To create a blank Python project we can do this by cliking "New Project" as shown below:

Now PyCharm asks us to configure the Python project.

In this example the project files will be in my /home/dolica/PyCharmProjects/first-pycharm-project directory but you're free to choose whatever suits you.

For the virtual environment we will be using Conda. in order to avoid confusion later on, the name of your virtual environment should match the name of the project.

The setup page also asks us if we wish to create a main.py welcome script. For this project, we will keep the box ticked.

Now that setup is complete, we can click Create.

The PyCharm Interface

Explain file list, editor, menu, etc.

Hi, Pycharm

Now you should see the PyCharm editor with our main.py file open. Here we have a print_hi command that has been created by PyCharm. Later on, you'll learn a bit more about how these things work and how you can create your own commands. Now we can run this file by clicking the green "play" button in the top right or by using the Shift + F10 command.

This now causes the "Run" panel to open at the bottom of the window. It shows the output of our code.

The text "Process finished with exit code 0" indicates that the program didn't crash.

While it may not be clear to you right now, the code in our main.py file is supposed to show the text "Hi, Pycharm". So we can clearly see that it's done what it was supposed to do.