Advanced Python Programming
Duration: 3 days
Skill Level: Intermediate and Beyond
Audience: Experienced Python programmers who wish to focus on Enterprise development.
Hands-On Format: This hands-on class is approximately 40/60 lab to lecture ratio, combining engaging
lecture, demos, group activities and discussions with comprehensive machine-based practical
programming labs and project work.
Module 1 -- Python refresher
Data types
Sequences
Mapping types
Program structure
Files and console I/O
Conditionals
Loops
Built-ins
Module 2 -- OS Services
The OS module
Environment variables
Launching external commands
Walking directory trees
Paths, directories, and filenames
Working with file systems
Dates and times
Module 3 -- Pythonic Programming
The Zen of Python
Common idioms
Lambda functions
List comprehensions
Generator expressions
String formatting
Module 4 – Modules and packages
Initialization code
Namespaces
Executing modules as scripts
Documentation
Packages and name resolution
Naming conventions
Using imports
Module 5 -- Classes
Defining classes
Instance methods and data
Properties
Initializers
Class and static methods/data
Inheritance
Module 6 -- Metaprogramming
Implicit properties
globals() and locals()
Working with attributes
The inspect module
Decorators
Monkey patching
Module 7 – Programmer tools
Analyzing programs
Using pylint
Testing code
Using unittest
Debugging
Profiling and benchmarking
Module 8 -- Database access
The DB API
Available Interfaces
Connecting to a server
Creating and executing a cursor
Fetching data
Parameterized statements
Metadata
Transaction control
Other DBMS modules
Module 9 -- Network Programming
Sockets
Clients
Servers
Application protocols
Forking servers
Binary data
Module 10 -- Multiprogramming
When to use threads?
The Global Interpreter Lock
The threading module
Simple threading
Sharing variables
The queue module
Debugging threaded programs
Multiprocessing
Other alternatives
Module 11 – XML and JSON
Working with XML
DOM and Sax
Introducing ElementTree and xml
Parsing XML
Navigating the document
Creating a new XML document
JSON
Parsing JSON into Python
Converting Python into JSON
Module 12 -- Extending Python
About non-Python modules
Overview of a C extension
Writing C by hand
Using SWIG
Loading modules with ctypes