Course 595:
Advanced Python Programming

(3 days)

 

Course Description

This is a second course in Python. The emphasis is learning about the modules available in Python and how to extend them. The course starts with a complete review of OO programming in Python including abstract base classes and the Python programmer’s tools—a debugger, trace. Then containers, algorithms, and iterators are presented to show fast methods of processing huge amounts of data. File system manipulation and XML, JSON, and YAML are viewed so that they can be manipulated inside of Python. Multiprocessing (and threads) are explored as methods of speeding up the process using multiple CPUs. How to use a microframework with examples from flask and bottle. How to do RESTful and endpoint techniques finish the course.

Note: This course uses Python 2.7.

Learning Objectives

At the end of this course, you will:

  • Know how to use a debugger, PyUnit, docTest, logging, and special environments
  • Be able to program decorators, closures, lambda, and list comprehensions
  • Understand how iterators and generators work
  • Learn modern data structures to include collections, array, and queues
  • Use platform independent file manipulation, file pattern matching
  • Know how to use mmap and temporary files
  • Be able to work with string files
  • Understand and be able to process HTML, JSON, and YAML
  • Be able to set up a client-server program using WebApp2 or Flask
  • Know how to use the Request module
  • Understand the design and Python implementation of REST
  • Know how to use threads and multiprocessing

Who Should Attend

Programmers who need to understand advanced concepts available through Python’s libraries.

Suggested Prerequisites

To receive maximum benefit from this course, the attendee should have background in Python equivalent to that provided by ROI Course 589: Python Programming Essentials.


Course Outline

Unit 1: Programming Tools

  • Pdb—Interactive Debuggers
  • Basic and Advanced unittest
  • Overview of doctest
  • Logging Introduction
  • Environment

Unit 2: Decorators, Closures, Lambda, and List Comprehensions

  • What Is a Decorator and Why Are They So Useful?
  • Understanding How Decorators Work
  • Using Decorators
  • Writing a Simple Decorator
  • Introduction to Closures
  • Lambdas vs. List Comprehensions

Unit 3: Iterators and Generators

  • Background on Iteration
  • Itertools
  • Iterfunctions
  • Operators
  • Generators

Unit 4: Data Structures

  • Collections
  • Arrays
  • Queues

Unit 5: Files Systems

  • Platform Independent File Manipulation
  • Pattern Matching
  • Temporary Files
  • Using mmap
  • String Files

Unit 6: Programming Background for Client-Server

  • URI, URL, URN
  • JSON, YAML, HTML
  • httplib and urllib

Unit 7: Simple Client-Server Programming 

  • Basic Architecture
  • Logging
  • Error Handling
  • Introduction Routing
  • Request Handlers
  • Daemon Processes

Unit 8: Client-Side with Requests

  • Accessing a Database
  • Static and Class Methods
  • Sending and Processing a GET
  • Sending and Processing a POST
  • Uploading and Downloading a File

Unit 9: REST Programming

  • REST Definition
  • Using REST Concept

Unit 10: Processes and Threads

  • External Commands
  • Signals and Timers
  • Overview of Threads
  • Details of Multiprocessing

Please Contact Your ROI Representative to Discuss Course Tailoring!