Advanced Python Training (PYT211)
Course Length: 2 days
Delivery Methods:
Available as private class only
Course Overview
In this Python training course, students already familiar with Python programming will learn advanced Python techniques.
Course Benefits
- Learn to work with the Collections module.
- Learn about mapping and filtering and lambda functions.
- Learn advanced sorting.
- Learn to work with regular expressions in Python.
- Learn to work with databases, CSV files, JSON, and XML.
- Learn to write object-oriented code in Python.
- Learn to test and debug your Python code.
- Learn about Unicode and text encoding.
Course Outline
- Advanced Python Concepts
- Lambda Functions
- Advanced List Comprehensions
- Quick Review of Basic List Comprehensions
- Multiple for Loops
- Rolling Five Dice
- Collections Module
- Named Tuples
- Default Dictionaries (defaultdict)
- Creating a defaultdict
- Ordered Dictionaries (OrderedDict)
- Creating a OrderedDict
- Counters
- Creating a Counter
- Deques (deque)
- Working with a deque
- Mapping and Filtering
- map(function, iterable, ...)
- filter(function, iterable)
- Using Lambda Functions with map() and filter()
- Mutable and Immutable Built-in Objects
- Strings are Immutable
- Lists are Mutable
- Sorting
- Sorting Lists in Place
- The sorted() Function
- Converting list.sort() to sorted(iterable)
- Sorting Sequences of Sequences
- Sorting Sequences of Dictionaries
- Unpacking Sequences in Function Calls
- Converting a String to a datetime.date Object
- Modules and Packages
- Modules
- Packages
- Search Path for Modules and Packages
- Working with Data
- Relational Databases
- PEP 0249 -- Python Database API Specification v2.0
- PyMySQL
- Returning Dictionaries instead of Tuples
- sqlite3
- Querying a SQLite Database
- Passing Parameters
- SQLite Database in Memory
- Executing Multiple Queries at Once
- Inserting File Data into a Database
- CSV...
- Reading from a CSV File
- Finding Data in a CSV File
- Comparing Data in a CSV File
- Creating a New CSV File
- CSV Dialects
- Getting Data from the Web
- The Requests Package
- Beautiful Soup
- XML
- Requests and Beautiful Soup
- JSON.
- Using JSON to print Course data
- Relational Databases
- Testing and Debugging
- Testing for Performance
- time.perf_counter()
- The timeit Module
- The unittest Module
- Unittest Test Files
- Fixing Functions
- Special unittest.TestCase Methods
- Assert Methods
- Testing for Performance
- Classes and Objects
- Attributes
- Behaviors
- Classes vs. Objects
- Everything Is an Object
- Creating Custom Classes
- Attributes and Methods
- Adding a roll() Method to Die
- Private Attributes
- Properties
- Creating Properties with the property() Function
- Creating Properties using the @property Decorator
- Properties
- Objects that Track their Own History
- Documenting Classes
- Using docstrings
- Documenting the Die Class
- Inheritance
- Overriding a Class Method
- Extending a Class
- Extending the Die Class
- Extending a Class Method
- Extending the roll() Method
- Static Methods
- Class Attributes and Methods
- Class Attributes
- Class Methods
- You Must Consider Subclasses
- Abstract Classes and Methods
- Understanding Decorators
Class Materials
Each student will receive a comprehensive set of materials, including course notes and all the class examples.
Class Prerequisites
Experience in the following is required for this Python class:
- Basic Python programming experience. In particular, you should be very comfortable with:
- Working with strings.
- Working with lists, tuples and dictionaries.
- Loops and conditionals.
- Writing your own functions.
Experience in the following would be useful for this Python class:
- Some exposure to HTML, XML, JSON, and SQL.