Teach Me Python #2: Your First Program

About: This project has expired.

Welcome to the second tutorial in the series. Today we will be coding your first python program.

Step 1: Open Geany

If you have been following the tutorial you should have downloaded and installed geany, to find it, look on your desktop if you installed desktop shortcuts if you have not, go into search and type in geany
Do not move the geany program. If you want to move it create a shortcut to it and move that instead

Step 2: The Code

After opening geany you should see something like the second image but without the untitled document open. The thing we are going to do is open a new document in new then immediately save it as helloworld.py. You should notice that in the bottom right corner it recognises the file as a python file. Next what we are going to do is type the following code:

print("Hello World")

What this does is the print statement will output the text in inverted commas to the terminal when it executed. The final step of this tutorial is to either press F5 on your keyboard or press the cog icon on the top bar in geany. This will execute your python script and a terminal should appear with the text 'Hello World'. If it comes up with any error it will be because you have misspelt something or python is not installed (see teach me python #1 for information on installing)



    • Trash to Treasure

      Trash to Treasure
    • Arduino Contest 2019

      Arduino Contest 2019
    • Tape Contest

      Tape Contest

    7 Discussions


    4 years ago on Introduction

    'python' is not recognized as an internal or external command,

    operable program, or batch file.

    I have the same problem. I have windows 8, Need I another versión of Python?

    1 reply

    None of mine work even though i have python downloaded. it says:

    'python' is not recognized as an internal or external command,

    operable program, or batch file.

    press any key to continue . . .

    any idea whats wrong?

    4 replies

    wht has happened is that you have incorrectly installed python if you are trying to install it on xp try active python (google active python) instead

    there was a thing that kept popping up when i installed it and im guessing my school blocked that part on the laptops but it said that you can skip it. could that be the problem. i think they have windows 7 on these computers

    2 things:

    1. The way school computers are set up generally you can download software however you cannot install it unless it is a .exe program and does not need to create any files (so if it is not an installer)

    2. If you skip a step on the installer it is likely to mess things up a bit

    However you could try finding a portable version of python which you could download to a usb stick