Advanced Python 3.x Programming

Hands-on Advanced Python | With Pythonic Programming, OS Services, DB Access, GUI, Networking, XML/JSON & Much More

Duration:

4 days

Audience:

Experienced Python programmers, focused on Enterprise Development that are employees of federal, state and local governments; and businesses working with the government.

This course is appropriate for advanced users, system administrators and web site administrators who want to use Python to support their server installations, as well as anyone else who wants to automate or simplify common tasks with the use of Python scripts.

Students should have basic development experience in any programming language, along with a working, user-level knowledge of Unix/Linux, Mac, or Windows.

Training Overview:

Geared for experienced Python programmers, Advanced Python Programming is a practical, hands-on Python training course that thoroughly explores intermediate to advanced level topics and skills, teaching students how to Leverage OS services, Code graphical interfaces for applications, Create modules, Create and run unit tests, Define classes, Interact with network services, Query databases, Process XML data and much more.  This comprehensive, practical course provides an in-depth exploration of working with the programming language, not an academic overview of syntax and grammar.

Course Topics Covered:

Working within in an engaging, hands-on learning environment, guided by our expert team, attendees will learn to:

  • Leverage OS services
  • Code graphical interfaces for applications
  • Create modules
  • Create and run unit tests
  • Define classes
  • Interact with network services
  • Query databases
  • Process XML data

Course Objectives:

Throughout the course students will be led through a series of progressively advanced topics, where each topic consists of lecture, group discussion, comprehensive hands-on lab exercises, and lab review. This course is “skills-centric”, designed to train attendees in essential, advanced Python and web development skills, coupling the most current, effective techniques with the soundest coding practices.

Skills-Focused, Hands On Learning:

This hands-on class is approximately 50% hands-on lab to 50% lecture ratio, combining engaging lecture, demos, group activities and discussions with machine-based practical programming student labs and project work.

Workshop Topics Covered:

Session: Python Refresher

  • Data types
  • Sequences
  • Mapping types
  • Program structure
  • Files and console I/O
  • Conditionals
  • Loops
  • Builtins

Session: OS Services

  • The os module
  • Environment variables
  • Launching external commands
  • Walking directory trees
  • Paths, directories, and filenames
  • Working with file systems
  • Dates and times

Session: Pythonic Programming

  • The Zen of Python
  • Common idioms
  • Lambda functions
  • List comprehensions
  • Generator expressions
  • String formatting

Session: Modules and packages

  • Initialization code
  • Namespaces
  • Executing modules as scripts
  • Documentation
  • Packages and name resolution
  • Naming conventions
  • Using imports

Session: Classes

  • Defining classes
  • Instance methods and data
  • Properties
  • Initializers
  • Class and static methods/data
  • Inheritance

Session: Metaprogramming

  • Implicit properties
  • globals() and locals()
  • Working with attributes
  • The inspect module
  • Decorators
  • Monkey patching

Session: Programmer tools

  • Analyzing programs
  • Using pylint
  • Testing code
  • Using unittest
  • Debugging
  • Profiling and benchmarking

Session: Distributing modules

  • Distribution concepts
  • setuptools
  • creating setup.py
  • building installers
  • running installers

Session: 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

Session: GUI Programming with PyQT4

  • About QT4
  • Getting started with the designer
  • Widget properties
  • Predefined dialogs
  • Generating the UI
  • Wiring up events
  • Advanced Topics

Session: Network Programming

  • Sockets
  • Clients
  • Servers
  • Application protocols
  • Forking servers
  • Binary data
  • The struct module

Session: Threads

  • When to use threads?
  • The Global Interpreter Lock
  • The threading module
  • Simple threading
  • Sharing variables
  • Threaded servers
  • The queue module
  • Debugging threaded programs
  • Alternatives to threading

Session: XML and JSON

  • Working with XML
  • DOM and Sax
  • Introducing ElementTree and lxml
  • Parsing XML
  • Navigating the document
  • Creating a new XML document
  • JSON
  • Parsing JSON into Python
  • Converting Python into JSON

Session: Extending Python

  • About non-Python modules
  • Overview of a C extension
  • Writing C by hand
  • Loading modules with ctypes

Session: Subprocesses

  • Running external commands with subprocess
  • Getting command status
  • Managing STDOUT, STDERR, and STDIN
  • The sh module (non-Windows systems only)
  • Creating a simple command
  • Keyword arguments
  • Running commands in the background
  • Piping and redirection
  • Working with STDIO
  • Exit codes
  • Advanced features

Need different skills or topics?  If your team requires different topics or tools, additional skills or custom approach, this course may be easily adjusted to accommodate.  We offer additional Python programming courses which may be blended with this course for a track that best suits your development objectives

Whether you are a student attending a public course, or a manager securing this training for your team, our team will collaborate with you to understand your needs and will target the course to focus on your specific learning objectives and goals.