Introduction

This chapter of the course covers the following objectives:

  • Describe how Communities of Practice provide value to programmers.
  • Use Python to create programs that accept user input and read and write to external files.
  • Create a Python application that accesses an API based on user input and processes and displays the JSON data that is returned.

Lab - PC Setup for Workshop

In this lab, you will complete the following objectives in order to prepare your computer for the course:

Part 1. Install and verify Python
Part 2. Install Postman
Part 3. Install JSONView

Install and verify Python.

Step 1

Go to Python and download the most recent version of Phyton 3.
When installing, make sure you check the "Add Phyton 3.6 to Path" checkbox, when setup finished, click the "Disable path length limit" if this option is available for your installation.

Step 2

For the Windows OS, open a command prompt enter the command python, as shown in Example 1. The interactive interpreter should open. Type quit() to exit the Python interactive interpreter.

Example 1. Opening Python on a Windows Computer
c:\>python Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 17:26:49) [MSC v.1900 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> quit()
Example 2. Opening Python on a Mac or Linux Computer
$ python3 Python 3.5.2 (default, Oct 3 2017, 17:48:00) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> quit()

Step 3

For the Windows OS, open IDLE from the Programs menu: Start > Python 3.6 > IDLE (Python 3.6 32-bit).
For the Mac or Linux OS, open a command prompt and enter the command idle3.
The IDLE shell should be open.

Step 4

The default Python installation comes with all the standard modules that most programmers would need to create applications. However, there are many more modules available that extend the functionality of Python. To keep initial installation of Python small, these modules are not includeing in the default package.
Returning to your command prompr window, use Python Package Index (accessed with the pip command) to download the modules requests and tabulate, as show for Windows in Example 3. for Linux and MAc, use pip3 install module_name.

Example 3. Installing Modules in Windows OS


Install Postman

HTTP API

Postman is a n application that you will use this course to make HTTP APLI requests.

Step 1

Postman is available as an application for Windows, Mac and Linux OS. To install Postman, go to the apps page and click Download for your OS.

Step 2

Sign up to use Postman or choose to create an account at another time.

Step 3

Verify that the Postman application is installed.

Install JSON View

JSON View is a Chrome extension that you will use in this course to better view JSON data.

Instalación de la extensión en Chrome.

Añadir la extensión siguiendo el enlace siguiente:
Extensión JSONView

Steps

Primero: Necesitamos tener instalado en nuestro equipo Chrome. En caso contrario click aquí
Segundo: En el buscador escribe JSONView Extension Chrome.
Tercero: Click en Añadir extensión y habilitar.
Éxito!

Capt. 1

Basic Concepts

Capt. 2

Data types, variables, basic input-output operations, ...

Capt. 3

Boolean vlaues, conditional executation, loops, lists and list processing, ...