First Python Program

To begin, we will proceed in the simplest way possible by choosing a very user-friendly IDE like Wing IDE. Next, we will create a variable of string type and print its value on the screen!

Step 1: Downloading and Installing Python

If you haven't installed Python yet, you can follow the instructions provided in our previous tutorial on "How To Install Python."

Step 2: Choosing and Installing an IDE

For this tutorial, we suggest using the Wing IDE, as it offers a user-friendly interface. The Wing IDE provides three versions:

  1. Wing Pro: A paid version with advanced features.
  2. Wing Personal: A free version suitable for most users.
  3. Wing 101: A simplified version designed specifically for beginners.

We recommend using the free version, Wing Personal. Once you have downloaded and installed the Python Wing IDE, you can launch it from the start menu.

Now, before diving into coding, it's essential to configure your IDE. To begin the configuration process, locate and click on the "IDE Wing configuration tool" within your chosen IDE.

Once you reach this stage, a new window called "Project Properties" will appear. In this window, choose the "Custom" option, and then click on the "Browse" button. Here, you can either select the Python interpreter executable or, if you have already added the path to the Python interpreter in the environment variables, you can simply leave it as the default option.




3. Step3: creation of a first Python program

From Wing's File menu, select "New":

A new tabbed editor pane appears. Type the code below:

In this initial program:

  1. We start by creating a new variable: of the string type called "s" (also referred to as string characters).
  2. The command "print(s)": is used to display the value of the string "s" on the screen.
  3. Before running the program: it is important to save it. To save the file, you can go to the File menu and select "Save," use the disk icon on the toolbar, or simply press Ctrl+S.
  4. A Save dialog box: will appear, then click on the "Save" button.

Now, it's time to execute your first program:
To run the program, ensure that the script you wish to run is the active tab (typically, there should only be one tab at this point). Then, click on the green button located in the top toolbar:

You should see in the shell, the output message: "This is my first program in Python!", like in the screenshot below:

 

Congratulations !

 

Younes Derfoufi
CRMEF OUJDA

Leave a Reply