Introduction to the PyCharm IDE

Creating Your First Project in PyCharm

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

PyCharm Startup Screen

To create a blank Python project, click on "New project."

Create New Project

PyCharm will now prompt you to configure the Python project:

Configure Python Project

In this example, the project files will reside in my /home/dolica/PyCharmProjects/first-pycharm-project directory. However, you can choose a location that suits your needs.

For the virtual environment, select Conda. PyCharm automatically makes the virtual environment's name match the project name, and this is something we wish to keep as it makes things less confusing. The setup page also asks if you want to create a main.py welcome script; for this project, you should keep this option checked. This will have PyCharm create a basic Python file for you instead of just preparing a blank directory.

Once the setup is complete, click "Create."

The PyCharm Interface

After creating your project, you'll land in the main PyCharm interface.

PyCharm Interface

Here's a quick overview:

Hi, PyCharm

Now you should see the PyCharm editor with our main.py file open. You'll notice a print_hi command created by PyCharm. You'll learn more about how these commands work and how to create your own later. For now, let's run this file:

Run main.py

This opens the "Run" panel at the bottom of the window, displaying the output:

Run Panel Output

The text "Process finished with exit code 0" indicates that the program ran without errors. Our main.py code is designed to display "Hi, PyCharm," and it has executed correctly.


Revision #15
Created 14 August 2023 10:51:40 by Dolica Akello-Egwel
Updated 22 August 2023 12:49:11 by Dolica Akello-Egwel