Understanding the Basics of Raspberry Pi by Marlon Smith

Understanding the Basics of Raspberry Pi by Marlon Smith

Author:Marlon Smith
Language: eng
Format: epub
Publisher: Speedy Publishing LLC


Chapter 5- Programming with Raspberry Pi

One of the simplest things that one will need to learn is how to write simple coding to produce simple text statements and instruct the computer to prompt end-users and ask them questions. To get started, the user may launch the Geany program located in the "Programming" list on the desktop start menu. Once the Geany program launches, the person can begin their first basic text program to get a basic idea on how Python programming works. The individual may go to "File" and select "New" and a new template will be loaded. The first line will be line #1 and this line tells the computer what programming language is being used. Since Python is being used, users can type in "#!/usr/bin/python" into line #1.

Next, the individual is capable of coding the program to display a line of text upon being executed. To do this, the person can type "print "Oh, yeah! I'm learning programming on the Raspberry Pi!". After the code has been typed, the person can save the template by going to "File" and selecting the "Save As" option. The user will need to save the file in a .py extension such as Raspberry_Pi_Programming.py so the system can recognize it. After the person has saved the file, they can click on the three small gray gears icon to run their compiled code. If written properly a terminal window will appear and display the text "Oh, yeah! I'm learning programming on the Raspberry Pi!" with a prompt to press the "Enter" key to exit.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.