Wall's Corners Wall's Corners Author
Title: Creating your first program
Author: Wall's Corners
Rating 5 of 5 Des:
This project will show you how to create your first program using Python , the programming language for beginners. First of all we need to ...

This project will show you how to create your first program using , the programming language for beginners.

First of all we need to install the programming software Geany, we are using the Fedora operating system for this tutorial.

In the Gnome system menu, go to Accessories and select Root Terminal.
You may be asked to enter the root password to continue.

Root terminal

We will now use the command terminal to download and then install the Geany programming software.
In the command line type apt-get install geany xterm and press enter to run the command.

Geany install

You will be told that the installation will use just over 9MB of storage space and you will be asked if you would like to continue. Press Y and press enter to continue.

Geany installed
The installation of Geany is now complete, you may now close the terminal.
We will now open Geany from the Gnome system menu by going to Programming and then selecting Geany.

You can now open Geany!

Once Geany is open, click on the File menu and navigate to New (with Template) and select main.py this will now open a new Python file for us to create our program with.

Creating a new file

When opening a new Python file, Geany automatically inserts unnecessary code.
As only the first line is needed for us to create our first program I usually delete the code so that only the first line remains.

Delete unnecessary codeWe are going to keep our first program very simple – When the program is run it will display a line of text.

Within the second line of the code type Print.
Notice how the word “Print” will change to purple which demonstrates that Geany has recognised Print as a function.

Print function

Insert a space after Print and enter the line of text that you would like to be displayed in the program within brackets.

Print text

Now click on the cogs icon to run your first program!

Run program
Your first program will now open in a new Window, although it’s only a simple program you should be proud of yourself!

Your first program!

Share This:

View more at: http://yoursmart.mobi

About Author

Advertisement

Post a Comment

 
Top