HomeSOFTWAREPython Installation And First Program

Python Installation And First Program

If you want to learn Python programming language, today’s article will interest you. Here we will deal with one of the currently most popular programming languages: Python! Due to its clear syntax and good readability, Python is ideally suited as an entry-level programming language. In the following lines, you will learn about Python and which steps have to be taken in advance so that you can write your first own program directly afterward.

How To Install Python

To learn and use Python, two essential components must be installed beforehand. On the one hand, these are Anaconda and, on the other hand, PyCharm. 

Installing Anaconda

Installing Anaconda sets up Python and a comprehensive software package containing many valuable components on the computer. This can be particularly helpful later on when programming with Python. To install Anaconda directly, first go to the following website in a browser: https://www.anaconda.com/products/individual. 

After the page has loaded successfully, click on the “Download” button, and you will be automatically directed to the corresponding download section. There you now select the installer suitable for your operating system and computer. This is usually the 64-bit Windows Installer. Select the Mac Installer to the right if you are working on a Mac. Clicking on the installer will now start the download.

Step By Step Installation Guide Of Anaconda (Windows)

  1. After downloading the Anaconda package, you can open it in your Downloads folder by double-clicking it.
  2. Click on “Next” here.
  3. Next, you will see the license agreements. To use Anaconda, one must accept these license agreements. If you agree, click “I Agree.”
  4. In the next step, the installation type must be selected. It is best to select “Just Me” here and then confirm by clicking on “Next.”
  5. In the next step, the installation location must be chosen. After you have determined the installation location, click “Next.”
  6. Next, you can select “Advanced Options.” Check the “Register Anaconda 3 as my default Python 3.8” box. Then click on “Install,” which will start the installation.
  7. Wait for the installation process to finish.
  8. After the installation is complete, the “Next” button appears. Now click on “Next.”
  9. The building is now completed. Now the development environment PyCharm is recommended to you. Ignore the recommendation and click “Next.”
  10. In the following window, you will be offered two checkboxes. Ensure that neither of these two ticks is checked, and then click on “Finish.” You have successfully installed Anaconda.

Step By Step Installation Guide Of Anaconda (MacOS)

  1. After downloading the Anaconda package, you can open it in your Downloads folder by double-clicking it.
  2. Click on “Continue” here for the following window.
  3. In the next step, various information about the package is listed. Click on “Continue” here.
  4. Next, you will see the license agreements. Next, click on “Continue.”
  5. You will then see a pop-up window asking you to accept the license agreement. To use Anaconda, one must take these license agreements. If you agree, click “Accept.”
  6. Next, you have to select the target volume, i.e., the location where Anaconda should be installed. It is best to select “Install for me only” and then confirm with “Continue.”
  7. Next, information appears explaining how much disk space is required for the installation. Now click on “Install” to start the installation.
  8. A window will now open, showing you the progress of the building. 
  9. Once the installation process is complete, you will be presented with a brief recommendation for the PyCharm IDE. Skip this step by clicking “Continue.”
  10. A small thank you window opens, in which helpful links and a Quick Start Guide are recommended again. Now click on “Close.”
  11. The installation is now completed. Next, you can move the installation file to the trash by clicking “Move to trash.” Congratulations! You have successfully installed Anaconda.

Installing PyCharm

In the next step, we install the second component: PyCharm. PyCharm is a so-called “development environment.” This has numerous useful tools that make it easier for us programmers to learn Python and make it more comfortable. You will find out what this means for you in practice later on. To install PyCharm directly, go to the following website in a browser of your choice. After the page has loaded successfully, click on the “Download” button in the “Community” column: This will start the download process.

Step By Step Installation Guide Of PyCharm (Windows)

  1. After successfully downloading PyCharm, you can open it in your Downloads folder by double-clicking it.
  2. Click on “Next” here to follow the installation wizard.
  3. The location where PyCharm should be saved must then be determined. After choosing the desired installation location, click on “Next.”
  4. The following installation options must then be selected. Check everything and click “Next.”
  5. Now click on “Install” to start the installation process for the following window.
  6. Now, wait for the installation process to finish. 
  7. Now click on “Finish” for the next window.
  8. Now start the application by double-clicking on the link. 
  9. Currently, the data protection declaration must be accepted. Then click on “Continue” for the following window.
  10. Click “Don’t Send” for the next window.
  11. The PyCharm welcome window will open. Click on “New Project” to create a new project.
  12. Select the options shown in the image and click “Create” for the following window.
  13. Click away from the “Tip of the Day” window as shown in the image. You have now successfully created your project in PyCharm. In the following sections and articles, you will now learn Python for the following action step by step.

Step By Step Installation Guide Of PyCharm (MacOS)

  1. After successfully downloading PyCharm, you can open it in your Downloads folder by double-clicking it.
  2. Click on “Open” for the following step.
  3. Confirm the terms of use by ticking the box and then clicking on “Continue” for the following step.
  4. Click “Don’t Send” for the following step.
  5. Select the left option, then click Next: UI Themes for the following action.
  6. You then have the opportunity to choose the theme. Since I like working in dark mode, I prefer the music “Darcula.” Then click on “Next: Launcher Script.”
  7. Do not check the box and click directly on “Next: Featured plugins” for the following step.
  8. Click on “Start using PyCharm” for the following action.
  9. Now, this window opens, which indicates that PyCharm has started. 
  10. As soon as PyCharm has been fully loaded, the welcome window opens. Click on “New Project.”
  11. Select the options shown in the image and click “Create” for the following step.
  12. Click away from the “Tip of the Day” window as shown in the image. You have now successfully created your project in PyCharm. In the following sections and articles, you will now learn Python for the following action step by step.

The “Hello World” Program

You are now ready to write your first program in Python. To not complicate learning Python at the beginning, we start here with the “Hello World” program, in which the sentence “Hello World” is output. This program can already be used to explain the first basic terms, which will also appear in the further course of the Python tutorial series. It also lets us check that everything has been installed and set up correctly. So let’s start with the implementation. In the beginning, as a new programmer, you may ask yourself the first question: Where do we write the program?

First, we need to create a new project in PyCharm. However, we can skip this step as we already did in the previous step. While we were doing this project, a so-called Python file was generated for use within the project. On the left, we can see the project structure. This is structured like the folder structure on your PC. By clicking on the arrow, you can expand and collapse the area and thus see what is inside the project. As already mentioned, there is a so-called Python file in our case. This can be recognized by the fact that the file’s name ends with .py because this ending characterizes such a file.

If the file is closed, which can be recognized by the fact that the editor is not displayed to the right of the project structure, it can be opened again by double-clicking on the “main.py” file. We can completely delete the already written code in this automatically generated Python file. Instead, we’ll write our simple “Hello World” program here. It works like this. First, we write the print command. We now report an open parenthesis directly after print and close it with another parenthesis. 

We now place two superscript double quotation marks between these round brackets and write the text Hello World between them. Finally, we set a line break. And that was about it. This line of code now causes Hello World to be printed. However, the text “Hello World” is only output if we run the program. And this works with PyCharm via the green arrow button in the top right corner. As soon as we click on this button, another window will open (the console) on which our text will be displayed. So it worked. 

Also Read: Ux Ui Design Software: What It Is And How To Become An Expert

RELATED ARTICLES

Latest Articles