Day 3: Creating your first project

Amy Sidra
4 min readJul 1, 2024

--

Photo by Alejandro Escamilla on Unsplash

On the third day, we will start our first project.
To create the project, follow these steps:

  1. Create a new repository on GitHub

This is the best approach. First, create the repository on GitHub, then clone it to your computer. Not the other way around — don’t create it on your computer first and then upload it to GitHub. You can create a new repository on GitHub as we learned on the second day. For now, we will use the project we created on the second day.

2. Clone to your computer

Open your GitHub account, go to “Repositories,” and click on the project you want to clone (in this case, our first project created on the second day).

Click the green “Code” button on the right and select SSH.

Copy the code.

Now let’s open PyCharm.

Select “Get from VCS.”

Paste the code you copied into the URL input, then choose the directory where you want to save the files.

Press “Clone.”

3. Creating a virtual environment.

Each project we create in Python needs its own virtual environment. Why? Imagine you are going to bake a cake; you will bring specific ingredients for it. When making soup, you will bring different ingredients than those for baking a cake. It would be cumbersome to carry all the cake ingredients when you’re making soup. Similarly, when we create projects in Python, each project has its own packages (ingredients). So, we create a virtual environment for each project to prevent the packages from getting mixed up with others.

you can make a virtual environment in PyCharm by click `Configure a Python interpreter`

if you missing it, you can add it from the setting. just follow the picture below

select project: Firstproject → python interpreter → Add interpreter

click new then click ok

if we succeed, the terminal should be like this

“HELLO WORD” Project

We will start by creating a new Python file.
Right-click on our project, then go to NewPython File.

Name the file (for example, main) and press Enter.

Check ‘Don’t ask again’ and click ‘Add’.

In the main tab, let's write our code, for example:

print(‘hello world’)

The print command is used to display text.

Click Run in the top right corner to execute it.

The result will appear in the bottom terminal.

Congratulations! You have created your first project.

When we want to finish a project, it’s recommended to upload it by pressing Ctrl + K.

Fill in the details of the changes and click Commit and Push.

Click Push and wait until it's done.

To see the results, please open your GitHub repository page. If there is a main.py file there, you have successfully uploaded your file.

If there’s anything else you’d like to know or need assistance with, feel free to ask!

Anyone Can Master Python in Just 7 Days

--

--