Python

Python Programming Training

Learn about Python from Instructors with Real World Expertise.

A 5 day intermediate course providing in-depth instructor-led python programming training.

Monitoring Training Overview:

This 5 day Python Programming training is in-depth instructor-led training (ILT). It covers all the core features of Python Programming, including basic types, sequence types, I/O Operations, control structures, regular expressions, development tools, object-oriented programming, database API and more.

Target Audience:

  • System Administrators
  • Developers
  • DevOps
  • Those wanting to understand and use Perl.

Structure: 50% theory 50% hands on lab exercises

Prerequisites: Proficiency with the Linux CLI. A broad understanding of Linux system administration.

Duration: 5 Days

Course Outline:

Introduction

Overview:

  • Why python?
  • Executing Python Code
  • Implications of PVM
  • Execution model variations
  • PyPy, Jython, IronPython, frozen binaries
  • Running python scripts
  • Python CLI features
  • Very basic control structures
  • If/elif/else
  • While/else
  • Try/except/finally
  • Function syntax
  • Vargs,key-value arguments
  • Function defaults
  • Type enforcements for functions
  • Scopes, the LEGB rule
  • Debugging python scripts
  • Pudb,ipdb
  • Modules/packages
  • Python search path for modules
  • Creating simple modules
  • Creating packages

Basic Types

Overview:
  • Basic types: numeric
  • Int, float, complex
  • Python3 changes on number arithmetic
  • Basic types: strings
  • String vs, Unicode (python2)
  • ByteString vs. String (python3)
  • Raw strings
  • Printing formatted output
  • Dealing with user input
  • String type
  • String manipulation functions
  • StringIO
  • The unicodedata module

Labs:

  • Simple Scripts

Sequence Types

Overview
  • Sequence types
  • Mutables vs. Inmutables
  • Working with list, array, bytearray
  • Slice operator
  • Interable objects, iterator
  • List/sequence functions
  • Manipulation elemens (append,extend, pop)
  • Sorting
  • The range/xrange function
  • The dictionary type
  • Restrictions
  • Getting keys/values/items
  • Dictionary iterators
  • Defaultdict, Counter
  • Using set/frozenset type
  • Set type features
  • Set operations
  • Other sequence types/functions
  • Basic aggregations: min, max, sum
  • The filter function
  • The map function
  • The reduce function
  • The collections module
  • The itertools module
  • Differences: python2 vs. python3

I/O Operation

Overview:

  • Basic file operations
  • Open, io.open, codecs.open
  • Iterating file objects
  • Fileinput module
  • Path operations
  • Os module functions
    • Os.path
    • Os.listdir
    • Os.walk
  • Glob module functions
    • Glob.glob
    • Glob.iglob
  • Communicate with external processes
  • Limitations of os.call, os.popen*
  • Subprocess module
    • Call
    • Popen
  • Parsing command line arguments
  • Getopt module
  • Argparse module

Additional Control Structures

Overview:
  • Context manager and with/as
  • Comprehensions
    • List comprehensions
    • Dictionary comprehensions
    • Generator comprehensions
    • Embedded comprehensions
  • Creating Generator Functions

Lab:

  • Creating Generator Functions

Regular Expressions in Python

Overview

  • Regular expression elements
    • Character ranges
    • Multipliers
    • Anchors
  • Re module functions
    • Match vs search
    • Findall vs finditer
    • Split
    • Sub
    • Compile
  • Use cases for flags
    • Single vs multi-line match
    • Unicode character ranges
    • Compile vs flags
  • Additional features in regular expressions
    • Back-referencing
      • Back-referencing in match
      • Back-referencing in sub
    • Capture groups
    • Referencing groups
    • Named groups
    • Embedded groups
  • Greediness

Lab: Regular Expressions

Python Development Tools

Overview

  • Document your code
    • Creating docstrings
    • Using Python doc framework Sphinx
  • Testing frameworks
    • The importance of testing in Python
    • Doctest
    • Unittest
    • Unittest + mock
    • Nose
  • Logging in python
    • Module logging
    • Logging configuration format
  • Parallel processing
  • Threading module
  • Multiprocessing module

Advanced Topics

Overview

  • Decorator
    • Simple decorators
    • Decorators with arguments
    • Python built-in function/class decorators
  • Performance tips

Object-Oriented Programming in Python

Overview

  • OOP basics
    • Compare OO features of Python and Java/C++
    • Python2 vs python3 classes
    • New-style vs old-style classes
    •  __slots__
  • Member functions
    • Contructors
    • Destructors
    • Writing member functions
  • Member attributes
    • General implementation of instance attributes
    • Class static attributes
    • Getter/setter methods
    • Access control solutions
      • The property class
      • The descriptor model
  • Operators
    • Operator related functions
    • __str__ vs __repr__
    • __call__
  • Class/function decorators
    • @staticmethod, @classmethod
    • @abstractmethod, @abstractproperty
    • @total ordering
  • Python class template
    • Inheritance
    • Abstract template classes
    • Metaclass

Lab:

  • Python OO

Python Database API

Overview

  • Connecting to DB API compliant Relational Database Management Systems
    • Creating and populating tables
    • Retrieving data records
    • Executing parametrized queries
    • Exporting and importing table data with Postgresql

Creating Graphical User Interfaces with Python/Tkinter

Overview

  • Tkinter widgets and their standard attributes ◦ Dimensions
    • Colors
    • Fonts
    • Anchors
    • Relief styles
    • Bitmaps
    • Cursors
  • Organizing widgets in the parent widget area
    • Using pack
    • Using grid
    • Using place

Introduction to the Python Django WEB Application Framework

Overview

  • Architecture
  • Creating a Hello world project
  • Managing settings
    • URL patterns

Lab:

  • Using Frameworks

Looking for something else? View all courses

Start Learning

Learn from Instructors with Real World Expertise.