Python II: Applied Python Training

We offer private customized training for groups of 3 or more attendees.

Course Description

This 4 day course picks up where Python I leaves off, covering some topics in more detail, and adding many new ones, with a focus on enterprise development. This is a hands-on programming class. All concepts are reinforced by informal practice during the lecture followed by lab exercises. Many labs build on earlier labs, which helps students retain the earlier material. Audience: Advanced users, system administrators and web site administrators who want to use Python to support their server installat ions, as well as anyone else who wants to automate or simplify common tasks with the use of Python scripts. Prerequisites: All students should be able to write simple Python scripts, using basic data types, program structures, and the standard Python library.
Course Length: 4 Days
Course Tuition: $1290 (US)


All students should be able to write simple Python scripts, using basic data types, program structures, and the standard Python libr ary

Course Outline


1. Python Refresher
Python Data Types
Mapping Types
Program Structure
Files an Console I/O
Defining a Function
Function Parameters

2. OS Services
The os Module
Environment Variables
Launching external programs
Paths, Directories and Filenames
Walking Directory Trees
Dates and Times
The Time Module
The Calendar Module

3. Pythonic Programming
Common Python Idioms
Slicing and Dicing
Unpacking Function Arguments
Lambda Functions
Nested Functions
List Comprehensions
Generator Expressions
Writing Generators
Python Time Travel
Three Python Easter Eggs
A String Trick
String Formatting

4. Modules and Packages
Using import
Initialization Code
Executing Modules as Scripts
Configuring Import with
Name Resolution (AKA scope)
Nested Functions
Python Style

5. Classes
About OO Programming
Defining Classes
Instance Methods
Class Methods and Data
Static Methods
"Private" Methods
Untangling the Nomenclature

6. Metaprogramming
Special Attributes
globals() and locals()
Working with Attributes
The inspect module
Decorator Functions
Decorator Classes
Decorating Classes
Creating Classes at Runtime
Monkey Patching

7. Objectives
Program Development
Customizing pylint
Using pyreverse
The unittest module
Skipping Tests
Making a suite of tests
Automated test discovery
Using Nose
The Python Debugger
Starting debug mode
Stepping through a Program
Setting Breakpoints

8. Distributing Modules
Installing Packages
Ways to distribute code
Overview of distutils
Preparing for distribution
Creating a source distribution
Creating built distributions Options Commands
Code Portability

9. Database Access
Available Interfaces
Connecting to a Server
Creating a Cursor
Executing a Statement
Fetching Data
Tip: Making an iterator for large queries
Parameterized Statements
Dictionary Cursors
Object-relational Mappers

10.qt GUI Programming with PyQt4
What is PyQt4?
Event Driven Applications
GUI Application Flow Chart
External Anatomy of a PyQt4
Internal Anatomy of a PyQt4
Using designer
Anatomy of a designer-based application
Naming Conventions
Common Widgets
Selectable Buttons
Making your application stretch
Actions and Events
Menu Bar
Status Bar
Using predefined dialogs
Creating Custom Dialogs
Working with Images GUI Programming with Tkinter
Tkinter Overview
Basic Tkinter Programming
Object-oriented Tkinter
Setting Fonts
Standard Colors
Variable Wrappers
Selectable Buttons
Text Entry Blanks
Multiline Text Entry/Display
Arranging Widgets
Using pack()
Tweaking the layout
Adding Scrollbars
Callback Parameters
Binding Events
Event Specifications
Creating Menus

11. Network Programming
Socket options
Client Concepts
Server Concepts
Application Protocols
Forking Servers
Grabbing HTML from the Web
Consuming Web Services
Web Data the Easier Way
Sending email
Binary Data
The struct module

12. Multiprogramming
What are Threads?
The Python Thread Manager
The threading module
Threads for the impatient
Creating a thread class
Variable Sharing
Using Queues
Debugging threaded programs
The multiprocessing module
Alternatives to multiprogramming

13. System Administration
The subprocess module
subprocess convenience functions
Using the sh module
Remote access
Other useful modules
Saving Information
Creating a useful command line script
Creating Filters
Parsing the command line
Simple logging
Logging Levels
Formatting Log Entries
Logging to other Destinations

14. XML and JSON
About XML
Normal approaches to XML
Which module to use?
Getting Started with ElementTree
How ElementTree works
Creating a new XML Document
Parsing an XML Document
Navigating the XML Document
Using XPath
About JSON
Reading JSON
Writing JSON

15. Extending Python
Why extend Python?
Ways to extend Python with C
Hand-coded C
The C Program
The Method Table
The init function
Handling errors
Custom exception objects
Putting it all together
Using SWIG
The interface file
Generating the Wrappers
Building and installing the extension

Appendix A: Books

Appendix B: String Formatting

Course Directory [training on all levels]

Upcoming Classes
Gain insight and ideas from students with different perspectives and experiences.

Python Programming Uses & Stats

Python Programming is Used For:
Web Development Video Games Desktop GUI's Software Development
Year Created
Easy to Learn:
The learning curve is very mild and the language is versatile and fast to develop.
Massive Libraries:
You can find a library for basically anything: from web development, through game development, to machine learning.
Do More with Less Code:
You can build prototypes and test out  ideas much quicker in Python than in other language

Speed Limitations:

It is an interpretive language and therefore much slower than compiled languages.

Problems with Threading:

Multi-threaded CPU-bound programs may be slower than single-threaded ones do to the Global Interpreter Lock (GIL) that allows only one thread to execute at a time.

Weak on Mobile:

Although, there are a number or libraries that provide a way to develop for both Android and iOS using Python currently Android and iOS don’t support Python as an official programming language.

Python Programming Job Market
Average Salary
Job Count
Top Job Locations

New York City

Mountain View

San Francisco

Complimentary Skills to have along with Python Programming
The potential for career growth, whether you are new to the industry or plan to expand your current skills, depends upon your interests:
  - For knowledge in building in PC or windows, phone apps or you are looking your future in Microsoft learn C#
  - For android apps and also cross platform apps then learn Java
  - If you are an Apple-holic and want to build iOS and MAC apps and then choose Objective C or Swift
  - Interested in game development? C++
  - Data mining or statistics then go with R programming or MATLAB
  - Building an operating systems? C

Interesting Reads Take a class with us and receive a book of your choosing for 50% off MSRP.