loading
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
----WARNING----
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)
<p> 'python' is not recognized as an internal or external command,</p><p>operable program, or batch file.</p><p>I have the same problem. I have windows 8, Need I another versi&oacute;n of Python?</p>
<p>all that says is that Python has not installed properly. Try using the instructions on their website</p>
<p>None of mine work even though i have python downloaded. it says:</p><p>'python' is not recognized as an internal or external command,</p><p>operable program, or batch file.</p><p>press any key to continue . . .</p><p>any idea whats wrong?</p>
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
<p>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</p>
<p>2 things:</p><p>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)</p><p>2. If you skip a step on the installer it is likely to mess things up a bit</p><p>However you could try finding a portable version of python which you could download to a usb stick</p>
<p>ill do that tomarrow thanks</p>

About This Instructable

981views

21favorites

License:

Bio: 1 new python tutorial every day Comment what you want the next one to be Please favourite and subscribe Notice Board: - since instructables has automatically ... More »
More by BlueBlood Studios:Teach Me Python #7: Control Statements Pt.2: While Loops Teach My Python #6: Control Statements Pt.1: If, Else And Elif Teach Me Python #5: Simple Maths 
Add instructable to: