Course Summary
Python Fundamentals is a 4-day training course in the Python language and its many applications. The course covers the language itself, explains object-oriented as well as functional programming techniques, error handling, packaging, system and network programming, many of the Python extensions (libraries), as well as best practices. All concepts are explained through hands-on examples and exercises, so students learn by coding in Python.Duration
4 days.
Objectives
This is a fast-paced lab course, designed to bring seasoned programmers up-to-speed in Python, as quickly as possible. While attending this course, you will experience:
- Pythonic thinking.
- Python's input and output details: stdio and file io.
- Python's interesting and extra-useful flow-of-control devices.
- Python's simple and robust error handling.
- Python's flexible function protocols.
- Python's memory model.
- Python's straight-forward object-oriented features.
- Python's built-in data types: using them, and inheriting from them in classes you design.
- Python's list comprehensions, decorators, iterators, generators, context managers.
- Python's scheme for creating and using libraries and packages.
- Python's handy libraries for many developer/administrator tasks: shutil, tempfile, subprocess, glob, profile, shelve, os, sys, optparse, unittest.
- Python's architecture, which allows you to get working very quickly with any Python library (there are thousands).
Audience
Instructors
Additional Notes
About the Platform
This course can be taught on most major operating systems, which support Python, such as Windows, Linux, Mac OS X, etc.
Trademarks
"Python" is a registered trademark of the Python Software Foundation. All other marks are the properties of their respective owners.
Outline
Output
- Executing a Python program
- Syntax: code blocks, colons
- if, elif and else
- while and another else
- Writing to stdout
- Relational and logical operators
Input
- Input from stdin
- Factory functions
- Catching an exception:
- yet another else
- Formatted strings
- Integer division issue
for range
- range operator
- for loop
- tuples
Functions
- Function protocols
- import and reload
- Module: random
- Introspection
Scope
- Indentifier scope
- Default arguments
- Keyword arguments
Sequences
- Sequence types: str, tuple, list
- Sequence slicing and other manipulations
Important Trick
- Module: sys
- Important trick:
- _name_and_'_main_'
- Valid identifiers
Comprehensions
- Scope issues
- List comprehensions
Dictionaries
- Importing with from
- Dictionaries
File IO
- File I/O
- Module: os
- Walking A Directory
Packages
- Modules: shutil, tempfile
- Python Packages
- Debugging
Dynamic Code
- Dynamic Code Generation
- Modules:
- subprocess
- glob
- profile
Function Fancies
- Function protocols: variable length argument lists
- Formatted printing using a dictionary for replacement
- Unpacking sequences and dictionaries
- Generators (Optional)
- Decorators (Optional)
OOP
- Module: shelve
- Classes
- Inheritance
- Class variable
Overriding
- Overriding
- Has-A vs Is-A relationships
New Style Classes
- Useful attributes
- Iterators
- New style classes
- Attribute control (Optional)
- property (Optional)
- Static methods (Optional)
- Class methods (Optional)
- Diamond inheritance (Optional)
Developer Modules
- Context Manager class
- Module: unittest
- Module: optparse
Wrap Up
- Exceptions
- Namespaces
- Nests
- Pitfalls
- Finding Modules and Help
re Module
- re - Regular Expressions
- Search and replace
- Named groups
re Syntax
- Regular expression syntax
- Testing regular expressions
Course Testimonials
This was an excellent course, well-designed for the audience, with appropriate pacing. Marilyn is an incredible instructor -- it was clear that she's been doing this for a long time. I enjoyed her humor and her depth of knowledge.
Instructor sat with students and aided/taught as student programmed - excellent
Excellent coverage of the techniques and pitfalls of Python Programming using extensive examples and code walk-through's.