Python 101 for Programmers
Steve Holden
Summary
In a three-hour gallop through the essentials of the Python language you will learn enough to be able to make sense of many of PyCon's beginner- and intermediate-level sessions.
If you have been thinking about starting to use Python but have not yet taken the first step this tutorial will quickly give you the basics of the language and help you get the most out of your attendance at PyCon.
Bring a laptop if you want to try out the code samples that Steve will be discussing. Everyone can ask questions to assist the learning process. If necessary follow-up sessions can be organized in Open Space.
Intended Audience
Programmers of other languages who want to find out more about Python; the idea is to help you make sense of code you will see in other PyCon presentations. A couple of years programming experience would be helpful but anyone who has programmed a computer should benefit from this tutorial.
Requirements
None, but a laptop with a recent (2.4 or later) Python installed would be useful to try out examples during the tutorial.
Detailed outline
Please note that you will be taking a three-day class in three hours. You are therefore necessarily going to have a limited time for hands-on exercises, but you are encouraged to try things out, and there will be some downloadable example materials for use during and after the tutorial.
Python Syntax Basics
Names
Numbers
Strings
Tuples
Lists
Dictionaries
Expressions
Statements
Assignment
The print statement
Program Flow Control
Indentation in Python
Conditional execution
Looping constructs
for
while
break
continue
Functions
Positional arguments
Keyword arguments
Function attributes
Useful builtin function
Exception Handling
The exception hierarchy
try ... except
try ... finally
Namespace Concepts
Name bindings
Memory allocation in Python
Object-Oriented Python
Defining classes
The class namespace
The instance namespace
The special __init__ method
Name resolution order
Specialising Classes
Inheritance Concepts
Mixin Classes
Modularity in Python
Role of the module
Namespaces
Importing modules
import
import ... from
Packages
Data structuring in Python
List comprehensions
Generators
Generator expressions
Instances as records
Formatting and I/O
Files and "file-like" objects
The % operator
Random access to files
Access to the Environment
The sys module
The os module
Running system commands
Python Documentation
The built-in documentation
Using pydoc
Other on-line sources
Presenter Bio
Steve Holden is the author of Python Web Programming and has given many well-received talks on Python topics including network programming, the wxPython GUI toolkit and the Python database API. He has been a Director of the Python Software Foundation for four years. Steve lives in Fairfax, VA with his wife and two cats.
With forty years programming experience, ten of them as a Python user, and fifteen years as a professional consultant, speaker and instructor, Steve has presented successful tutorials at the last two PyCons.
























.