Python Programming for Raspberry Pi, Sams Teach Yourself in 24 Hours

(singke) #1

Summary


In this hour, you learned about the history of Python, how to ensure that the proper Python tools are
installed, and how to make sure your keyboard is set up correctly. You took a first look at how to use
tools to test Python statements, and you learned how to create and run Python scripts.


Up to this point in the book, you have been setting up and learning about the Python development
environment. Now that hard work is about to pay off. In Hour 4, “Understanding Python Basics,” you
will be typing in some real Python statements.


Q&A


Q. Do I have to use the nano text editor?
A. No. You can use the basic text editor within IDLE rather than nano. You can also try Leaf Pad
or install another text editor, such as gedit. If you are really into pain and suffering, you can
even install and use the vi/vim text editor.
Q. Can I use a word processor to create Python scripts?
A. Yes, you can! However, you must save the files you create as plain text files.
Q. Do I have to use IDLE?
A. No. However, it would be wise to use and learn at least one development environment tool.
As you learn the concepts in this book, the scripts and code segments will be fairly small. But
when you start writing scripts for yourself, they may get rather large! This is where knowing a
development environment will be very helpful.

Workshop


Quiz


1. When you save a Python script, the file extension should be .python. True or false?
2. Where did the Python programming language get its name?
a. Monty Python’s Flying Circus
b. The python snake
c. Mount Python in Greece
3. In IDLE interactive mode, what color indicates a string literal?

Answers


1. False. The file extension for Python scripts is .py.
2. The Python programming language got its name from Monty Python’s Flying Circus.
3. In IDLE interactive mode, the color green indicates a string literal.
Free download pdf