Conventions
In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: " By default, the pip
package management system that makes it easy to install and manage software packages written in Python isn't installed."
A block of code is set as follows:
if __name__ == "__main__": print ("Mraa library version: {0}".format(mraa.getVersion())) print ("Mraa detected platform name: {0}".format(mraa.getPlatformName())) number_in_leds = NumberInLeds() # Count from 0 to 9 for i in range(0, 10): number_in_leds.print_number(i) time.sleep(3)
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
class NumberInLeds: def __init__(self): self.leds = [] for i in range(9, 0, -1): led = Led(i, 10 - i) self.leds.append(led) def print_number(self, number): print("==== Turning on {0} LEDs ====".format(number)) for j in range(0, number): self.leds[j].turn_on() for k in range(number, 9): self.leds[k].turn_off()
New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "The next time you have to upload a file to the board, you don't need to set up a new site in the Site Manager dialog box in order to establish an SFTP connection."
Note
Warnings or important notes appear in a box like this.
Tip
Tips and tricks appear like this.