Welcome to my Python Fundamentals Course!
Following are additional resources, links, and documentation that may come in handy on your Python learning adventure.
Windows users should make sure they have a usable python development environment set up.
- Learn Python the Hard Way!
- The official Python docs (but try help and dir first)
- The Official Python Tutorial (covering roughly the same ground as our fundamentals course)
- Code like a Pythonista: read this and your code will be pythonic.
- Doug Hellman's Python Module of the Week - a great way to get to know Python's vast stdlib.
- Python in a Nutshell (my favorite reference)
- Dive into Python Online Book - somewhat dated but still good and free online book.
- An overview of the Python ecosystem as of late 2011
- pythontutor.com - visualizations of running Python code
Important Basics You Should Know
Python builtin functions: see the http://docs.python.org/library/functions.html. Or
import __builtin__ dir(__builtin__)
Keywords: see the docs http://docs.python.org/reference/lexical_analysis.html#keywords. Or
import keyword print(keyword.kwlist)
- Use tools to check the style and correctness of your code - pylint and pep8.py
- PDB - the stdlib python console debugger
- IPython - a better python shell
- Python Regex Testing Tool
- virtualenv and virtualenvwrapper - tools for managing python environments. If you find yourself installing 3rd party python code you should be using these tools.
- Stuck on windows? Use a replacement console for a much better experience.
- Need an IDE? I recommend Notepad++ for windows users needing a text editor (but be sure to set the Preferences -> Language Menu/Tab Settings -> Replace Tab with Spaces checkbox and set the width to 4). If you want more IDE'ish features look at this list - for long time programmers I might recommend PyDev (built on Eclipse) and for newer programmers I recommend Pyscripter. If you're using Linux take the time to learn vi or Emacs (or both!)
- Or just append to your .vimrc (thanks Matt Smith!)
" Tabs converted to 4 spaces set shiftwidth=4 set tabstop=4 set expandtab set smarttab set backspace=indent,eol,start "Optional: Enable syntax highlighting if your install "supports it set nocompatible filetype on
Additional Documentation Referred to in Class
- Simple String Formatting
- Built In Exception Types
- Quick Doctest Overview - but I like to use
$ python -m doctest -v myfile.py
- Don't forget the first dunderscore hack you'll need:
if __name__ == '__main__': main()
- A great walkthrough of the stdlib logging module
- JSON in stdlib
- List of dunderscore methods
- PyMOTW coverage of CSV module
- PyMOTW UnitTest
- More than you could possibly want to know about dunderscore methods
- my PDB tutorial video
- David Beazley's great paper on generators
Don't forget the old labs! Also see saved interactive ipython shell sessions (day1, day2, day3, and day 4.) - this contains all the code (mistakes and all) I typed in the most recent class in response to questions.
ps - Go forth and code - but don't do this!