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.

  1. Python Syntax Basics

    Names

    Numbers

    Strings

    Tuples

    Lists

    Dictionaries

    Expressions

    Statements

    Assignment

    The print statement

  2. Program Flow Control

    Indentation in Python

    Conditional execution

    Looping constructs

    for

    while

    break

    continue

  3. Functions

    Positional arguments

    Keyword arguments

    Function attributes

    Useful builtin function

  4. Exception Handling

    The exception hierarchy

    try ... except

    try ... finally

  5. Namespace Concepts

    Name bindings

    Memory allocation in Python

  6. Object-Oriented Python

    Defining classes

    The class namespace

    The instance namespace

    The special __init__ method

    Name resolution order

  7. Specialising Classes

    Inheritance Concepts

    Mixin Classes

  8. Modularity in Python

    Role of the module

    Namespaces

    Importing modules

    import

    import ... from

    Packages

  9. Data structuring in Python

    List comprehensions

    Generators

    Generator expressions

    Instances as records

  10. Formatting and I/O

    Files and "file-like" objects

    The % operator

    Random access to files

  11. Access to the Environment

    The sys module

    The os module

    Running system commands

  12. 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.

Diamond

  • Google - Diamond
  • White Oak Technologies - Diamond

Platinum

  • Zenoss - Platinum
  • Enthought - Platinum
  • Microsoft Port 25 - Platinum
  • Sun Microsystems - Platinum

Gold

  • Wingware - Gold
  • Resolver Systems - Gold
  • ITA Software - Gold
  • Leapfrog Online - Gold
  • Predictix - Gold
  • Accense Technology, Inc. - Gold
  • IronPort - Gold

Silver

  • Imaginary Landscape - Silver
  • Tummy.com - Silver
  • Activestate - Silver
  • PSC Consulting - Silver
  • Canonical - Silver
  • ZeOmega - Silver
  • Symbian Press-Forum Nokia - Silver
  • Nuance Communications - Silver
  • CCP Games - Silver
  • Fivedash.com - Silver
  • Rackspace - Silver
  • Quality Vision International - Silver

Vendor II

  • O'Reilly - Vendor II
  • Pearson Publishing - Vendor II