Python Resources
From Simson Garfinkel
For Learning Python
I've reviewed these resources and highly recommend them:
- Start with the Official Python Documentation, including the tutorial
- Advanced Python or Understanding Python, Thomas Wouters, Google Tech Talks, February 21, 2007
- Dive Into Python 3 (book, online for free)
- Python Tips (book, online for free)
- Python for Non-Programmers
- https://www.learnpython.org, powered by DataCamp. For example, look at the String Formatting lesson
- Python Google Style Guide.
Data Representation
Numerical Datas
- numpy - numeric analysis in python (needed for matplotlib)
- tabulate - create tables easily
- jupyter notebook
Date Data
String Formatting
Text Processing
Graphing, Graphics and Games
Graphing
- matplotlib - a handy system for plotting in python. (Short example of using matplotlib within jupyter)
- Altair: Declarative Visualization in Python
- geopy - geocoding for Python
- Seaborn. (See Datacamp Tutorial)
Easy Graphics
- Graphics.py: http://mcsp.wartburg.edu/zelle/python/graphics.py http://mcsp.wartburg.edu/zelle/python/ http://mcsp.wartburg.edu/zelle/python/graphics/graphics.pdf
- HTML graphics: http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/graphics.html
- http://plotdevice.io/
- http://www.cc.gatech.edu/classes/AY2013/cs1301_summer/presentations/calico_graphics.pdf
Games
- http://www.pygame.org/ pygame - a Python game development system
- PEAK Easy Install
- Crystal Space 3D
- VPython 3D Programming in Python
Image Manipulation
- Use Pillow, the Python2/3 fork of Python Image Library (PIL).
Fun examples:
- http://jeremykun.com/2012/01/01/random-psychedelic-art/
- http://pythonvision.org/basic-tutorial
- http://stackoverflow.com/questions/138250/read-the-rgb-value-of-a-given-pixel-in-python-programatically
Python GUI Options
I need to write some programs that use GUI.
- tkinter - built in, but not recommended
- pyqt - Use PyQT5 (it's part of Anaconda)
- wxwidgets - It's okay, but use PyQT5
- wikibooks has a page on Python Program/GUI Programming options
- FLTK, the Fast Light Toolkit
Resources for Tkinter
- Chapter 18 of Core Python Programming discusses GUI Programming with Tkinter
- Programming Python, 2nd Edition, Chapter 7 and 8
- reddit has a page on Python 3.x books for Tkinter
- Introduction to Tkinter on effbot.org
- Python 3.2 tkinter doc
- Thinking in Tkinter
- Python wiki 'GUI Programming in Python'
- Python 2.7 Tkinter Doc
- Original 'An introduced to Tkinter' by Fredrik Lundh
Building Web Applications
You basically have two options:
- Write a CGI script (slow, but easy)
- Some sort of Web Server Gateway Interface (WSGI)
- See also https://wiki.python.org/moin/WebFrameworks
Examples and resources:
- https://github.com/MichaelPereira/webhooks-demo-application
- https://mattcarrier.com/flask-dreamhost-setup/
- https://www.byteconsole.com/get-flask-up-and-running-on-a-dreamhost-server-with-passenger/
WSGI options
- Flask (can run on Apache with Passenger, but needs its own domain name)
- CherryPy
Notes on Flask
$ touch tmp/restart.txt # reload your program
Using Passengers on Dreamhost
- https://help.dreamhost.com/hc/en-us/articles/215769578-Passenger-overview
- https://help.dreamhost.com/hc/en-us/articles/216137717-Python-overview
- https://help.dreamhost.com/hc/en-us/articles/115000218612-Installing-a-custom-version-of-Python
- https://help.dreamhost.com/hc/en-us/articles/115000702772-Installing-a-custom-version-of-Python-3
- https://help.dreamhost.com/hc/en-us/articles/215489338-Installing-virtualenv-and-custom-modules-in-Python
- https://help.dreamhost.com/hc/en-us/articles/115000221112-Using-pip-to-install-Python-modules
Python Installation
If you are using a Mac, you almost certainly want to ditch Apple's python implementation and instead install your own.
I now recommend the Anaconda Python distribution, because it has almost everything that you need, and it's easy to add new modules.
If you want to write a Python program with a GUI that can be run on any system, you'll need to use Tkinter (Python's Tcl/Tk bindings). If you want to actually enjoy what you are writing, you want to use PyQT5..