Advanced Python

Duration

35 hours or 5 classroom days

Course Overview

The objective of this class is to push students beyond print( 'hello world' ). Students work to develop Python scripts that handle exceptions, interface with the operating system, communicating with RESTful (and non-RESTful) APIs, understand and write complex scripts with multiple threads, and learn to work with libraries, like NAPALM, to automate L2 and L3 network devices across a wide breadth of vendors (Juniper, Cisco, Arista, to name a few). Other skills students will learn include; parsing data structures (such as XML, YAML, and JSON), writing and creating highly efficient regular expression, best practices and code review, and interacting with IMAP (email).

Download Detailed Outlline

Advanced Python

5 days with Hands-on Labs

- Recommended Prerequisite: Python Basics (5 days)

- Recommended Follow Up: Python for Network Automation (5 days)


  • Exceptions
    • About Exceptions
    • Python's Default Exception Handler
    • Using Try/Except/Finally Exceptions
    • Generating User Defined Exceptions
    • More on Exceptions
    • Exception Examples
    • Using Asserts
    • Exception Classes
  • Python Generators
    • About Generators
    • Generator Syntax
    • Communicating with Generators with send()
  • OS Interfacing
    • About the sys & os Modules
    • Gleaning More Using __doc__ & help()
    • Common sys Module Attributes & Methods
    • Working With the os Module & Files/Directories
    • File & Path Examples
    • Working with os.path
    • os & os.path Module Examples
    • Running Shell Commands
  • Accessing Databases with Python
    • About Database Access
    • About psycopg2
    • PostgreSQL Connect Strings
    • Cursor Objects
    • PsychoPG2 Examples
  • Python & the Web
    • About the Web
    • Understanding HTTP
    • Using the CGI Module
  • Python Decorators
      • About Decorators
      • Simple Function Decorators
      • Classes as Decorators
      • Chained Decorators
      • Decorator Arguments
      • Exercises
    • Python Regular Expressions
      • About Regular Expressions
      • re Basics
      • Expression Basics
      • Using match() and search()
      • Working with Match Objects
      • Other re Module Functions
      • Passing in Modifier Flags
      • Exercises
    • Sockets & Networking
      • Socket Basics
      • The Socket Module
        • Network Clients
      • Creating Network Servers
        • Example Server
      • Exercises
    • Python Protocol Clients
      • Protocol Support
      • Exercises
    • Generating & Sending Email
      • The email Module
      • Creating Simple Emails
      • Creating a Message
      • Creating SMTP Connections
      • SMTP Methods
      • Exercises
    • Processes and Threads
      • Running Shell Commands
      • Popen Objects
      • Using Parallel Processing
      • Using Python's os.fork() Function
      • Using os.exec*() Variants
      • Exercises
      • Python Threads
      • The threading Module
      • Thread Objects
      • Custom Thread Objects
      • Working with Locks
      • Using Reentrant Locks
      • Condition Objects
      • Exercises
      • Using the Queue Object
      • Using Semaphores
      • Using with for Locks, RLocks, Condition & Sempahores
      • Event Objects
      • Timer Objects
      • Processing Exit Codes
      • Exercises
      • The multiprocessing Module
      • Using multiprocessing
      • Exchanging Objects
      • Using Pipes
      • Synchronization
      • Using multiprocess Managers
    • Signal Handling
      • The Signal Module
      • Defining Signal Handlers
      • Signal Numbers
      • Common Signal Module Functions
      • Using set_wakeup_fd()
      • Using Timers
      • Other Signal Notes
      • Exercises
    • Introduction to Twisted
      • About Twisted
      • Installing Twisted
      • Twisted Basics
      • The Twisted Reactor
        • Using CallLater
      • Understanding Deferred Objects
      • Creating Deferred Objects
      • Stacking Callbacks
      • Stacking Deferred
      • What about concurrency?
        • Exercises
    • Networking with Twisted
      • Networking Basics
      • Creating a ClientFactory
      • Twisted Failures
      • Protocol Objects
      • Creating Network Clients
      • Creating SSL Clients
      • SSL Context
      • Twisted Helpers
      • Twisted Protocol Support
      • Using Twisted SMTP Protocol Support
      • Twisted.mail.SMTP.sendmail() Explained
      • Mail Exchange Lookups with MXCalculator
      • Using the ESMTPSenderFactory
        • Example
      • More Factories
        • Exercises
    • Providing Services with Twisted
      • Creating Listeners
      • Server Example
        • Exercises
      • Using the Twist Daemonizer (twistd)
      • Creating tac Files
      • Managing Services with twistd
      • Logging with twistd
    • Unit Testing with unittest (PyUnit)
      • About unittest (PyUnit)
      • The TestCase Class
      • TestCase Methods
      • Checking & Reporting Failures
      • Setting up Simple Tests
      • Compiling Test Suites
      • Working with TestResult Objects
      • Using TestLoader Objects
      • Exercises
    • Code Review
      • Code review checklist
      • https://smartbear.com/learn/code-review/best-practices-for-peer-code-review/
      • Mergeable
      • Pass tests
      • What to do if code introduces new functionality
      • Check for code coverage with `make clean diff-cover`
      • Well formatted
        • make pep8
        • make diff_pylint_report
        • make cppcheck
        • make doc
        • make format` and manual fixing as needed.
      • What to do if command-line interface changes?
        • What requires a major version increment
      • File format changes
      • ChangeLog documentation
      • Spell checking
      • Plain text rules for tabs, spaces, indent, etc
      • Test streaming IO
      • Copyright year and other misc items
    • Globbing
      • Using Glob
      • Exercises
    • XML Processing
      • About XML
      • The ElementTree XML API
      • The Element Class
      • Using Elements
      • Creating New Elements
      • Xpath Style Queries
      • Creating & Saving XML Files
    python2_tutorial

    Enroll

    Self-paced: $ --- USD

    • Digital course materials COMING SOON!
    • Includes 1 year access to videos
    • 60 day access to hands-on labs

    Live Instructor via the web: $ 2595 USD

    • Virtual web-based presentation
    • A teacher to guide you
    • Plus all the self-paced items

    Bring us Onsite:

    • Contact us for onsite quotes

    Next Public Course Offerings:



    Testimonials

    Different plans for everyone

    Choose the pricing that fits your business needs

    Live Instructor via the Web
    $ 2595
  • Virtual web-based presentation
  • A teacher to guide you
  • Plus all the self-paced items
  • Buy Instructor Led

    Onsite
    Contact Us
  • Instructor led class
  • Hands-on Lab access
  • Digital Course Materials
  • 1 year access to labs
  • Contact Us