Book Image

Mastering IOT

By : Colin Dow, Perry Lea
Book Image

Mastering IOT

By: Colin Dow, Perry Lea

Overview of this book

The Internet of Things (IoT) is the fastest growing technology market. Industries are embracing IoT technologies to improve operational expenses, product life, and people's well-being. We’ll begin our journey with an introduction to Raspberry Pi and quickly jump right into Python programming. We’ll learn all concepts through multiple projects, and then reinforce our learnings by creating an IoT robot car. We’ll examine modern sensor systems and focus on what their power and functionality can bring to our system. We’ll also gain insight into cloud and fog architectures, including the OpenFog standards. The Learning Path will conclude by discussing three forms of prevalent attacks and ways to improve the security of our IoT infrastructure. By the end of this Learning Path, we will have traversed the entire spectrum of technologies needed to build a successful IoT system, and will have the confidence to build, secure, and monitor our IoT infrastructure. This Learning Path includes content from the following Packt products: Internet of Things Programming Projects by Colin Dow Internet of Things for Architects by Perry Lea
Table of Contents (34 chapters)
Title Page
Copyright
About Packt
Contributors
Preface
Free Chapter
1
The IoT Story
Index

Using the Python command line


Let's start doing some coding. Whenever I start using a new operating system for development, I like to go through some basics just to get my mind back into it (I'm speaking particularly to those of us who are all too familiar with coding into the wee hours of the morning).

The simplest way to access Python is from the Terminal. We will run a simple program to get started. Load the Terminal from the main toolbar and type python3 at the prompt. Type the following line and hit Enter:

from datetime import datetime

This line loads the datetime object from the datetime module into our instance of Python. Next type the following and hit Enter:

print(datetime.now())

You should see the current date and time printed to the screen:

Let's try another example. Type the following into the shell:

import pyjokes

This is a library that's used to tell programming jokes. To have a joke printed out, type the following and hit Enter:

pyjokes.get_joke()

You should see the following output...