Home   |    Blog   |    Contact

Conquering Python for Experienced Programmers

The better you understand what it means to be Pythonic, the better your code will be.

Becoming Pythonic

When code is Pythonic, it's code that properly uses the idioms of Python to accomplish tasks in a clean, powerful manner.

When a programmer becomes Pythonic, they achieve a state of mind that allows them to solve previously hard or impossible problems, because the programmer actually understands how Python works, and is thus able to go with the flow instead of fighting things.

This is not academic. It's not about theoretical approaches that fall apart in the real world. It's about getting your job done in fewer lines of code, faster, and more maintainably.

Class details

Audience: Anyone with a comfortable background in programming.

Length: 2-3 days, depending on options chosen.

Approach: Each topic starts with a very interactive, discussion-based lecture where I do live coding to explain concepts, punctuated by student exercises. The level of depth for each topic, and what optional topics we cover, is heavily influenced by the interest and needs of the students. Students receive book-length HTML and Jupyter Notebook files of the entire class content.

Pure Python (2 days)

Part 1: Hello Python

  • The Object Model: Understanding that everything is an object is the key
  • Control Flow: Uh oh, whitespace significance!
  • Importing: Using libraries
  • Lists: Python is pretty much a language about handling lists
  • Strings: Constructing and using strings efficiently
  • Files: Reading and writing
  • Unicode: Yes, you do need to understand it! And I promise it'll be fun...
  • Functions: Python is a quasi-functional language (fighting words)
  • Handling Exceptions: It's so much more than just dealing with errors!

Part 2: Lists

  • Comprehensions: Finally, you'll understand them
  • Sorting: Default sorting and custom sorting
  • Tuples: Why is there a kind of list you can't change?
  • Sets: The most overlooked incredibly useful class
  • Dictionaries: The mini-database
  • Generators: The secret gem of Python

Optional topics

You can pick and choose among these based on your needs.

Data Science

  • Regular expressions
  • Pandas for parsing tabular data
  • Series as a first-class Python citizen
  • NumPy
  • JSON
  • Databases using sqlite3
  • Map/Filter/Reduce

Automation and Workflow

  • Command-line operations in Python: executing other scripts, etc.
  • File handling: Copying and moving files around
  • Websites: Accessing websites, using JSON
  • Packaging code: How to create libraries for you and your team

Object-Oriented Programming

  • Creating basic objects: What is this 'self' thing?
  • Accessing built-in Python functionality: The 'dunder' methods
  • Creating Exceptions
  • OOP in Python: decorators, properties, class methods