Difference between revisions of "Python Resources"

From Simson Garfinkel
Jump to navigationJump to search
(21 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Python Source Code and Modules==
==For Learning Python==
* ipython - a friendly interactive shell for python. [http://ipython.scipy.org/moin/ Info] [http://www.onlamp.com/pub/a/python/2005/01/27/ipython.html ONLamp Article]
I've reviewed these resources and highly recommend them:
* [http://matplotlib.sourceforge.net/ matplotlib] - a handy system for plotting in python.
* Start with the [https://docs.python.org/3/ Official Python Documentation], including the tutorial
* [http://video.google.com/videoplay?docid=7760178035196894549 Advanced Python or Understanding Python], Thomas Wouters, Google Tech Talks, February 21, 2007
* [http://www.diveintopython3.net/ Dive Into Python 3] (book, online for free)
* [http://book.pythontips.com/en/latest/index.html Python Tips] (book, online for free)
* [https://wiki.python.org/moin/BeginnersGuide/NonProgrammers Python for Non-Programmers]
* https://www.learnpython.org, powered by DataCamp. For example, look at the [https://www.learnpython.org/en/String_Formatting String Formatting] lesson
* [https://github.com/google/styleguide/blob/gh-pages/pyguide.md Python Google Style Guide].
 
==Data Representation==
===Numerical Datas===
* numpy - numeric analysis in python (needed for matplotlib)
* numpy - numeric analysis in python (needed for matplotlib)
* tabulate - create tables easily
* jupyter notebook
===Date Data===
* [http://labix.org/python-dateutil dateutil]  
* [http://labix.org/python-dateutil dateutil]  
* [http://www.crystalspace3d.org/ Crystal Space 3D]
* [http://pyx.sourceforge.net/ PyX] - A Python PS and PDF graphing package
* [http://www.pygame.org/ pygame] - a Python game development system
* [http://codespeak.net/icalendar/ iCalendar] package for Python
* [http://codespeak.net/icalendar/ iCalendar] package for Python
* [http://www.vpython.org/ VPython] - 3D Programming in Python
 
===String Formatting===
* https://pyformat.info
 
== Text Processing ==
See [[Text processing notes]].
 
==Graphing, Graphics and Games==
===Graphing===
* [http://matplotlib.org/ matplotlib] - a handy system for plotting in python. ([[Short example of using matplotlib within jupyter]])
* [https://altair-viz.github.io/index.html Altair: Declarative Visualization in Python]
* [https://github.com/geopy/geopy geopy] - geocoding for Python
* Seaborn. (See [https://www.datacamp.com/community/tutorials/seaborn-python-tutorial 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
* [http://peak.telecommunity.com/DevCenter/EasyInstall PEAK Easy Install]
* [http://peak.telecommunity.com/DevCenter/EasyInstall PEAK Easy Install]
* [http://www.crystalspace3d.org/ Crystal Space 3D]
* [http://www.vpython.org/ 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==
===Python GUI Options===
I need to write some programs that use GUI. Python TKinter is available on all versions of Python, but on the Mac it is slow to start and uses XWindows. Here are some options I'm thinking of:
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
* [http://en.wikibooks.org/wiki/Python_Programming/GUI_Programming wikibooks] has a page on Python Program/GUI Programming options
* [http://en.wikibooks.org/wiki/Python_Programming/GUI_Programming wikibooks] has a page on Python Program/GUI Programming options
* [http://www.fltk.org/ FLTK], the Fast Light Toolkit


Books on Tkinter:
===Resources for  Tkinter===
* [http://my.safaribooksonline.com/book/programming/python/0130260363/advanced-topics/ch18#X2ludGVybmFsX0ZsYXNoUmVhZGVyP3htbGlkPTAtMTMtMDI2MDM2LTMvNDA5 Chapter 18 of Core Python Programming] discusses GUI Programming with Tkinter
* [http://my.safaribooksonline.com/book/programming/python/0130260363/advanced-topics/ch18#X2ludGVybmFsX0ZsYXNoUmVhZGVyP3htbGlkPTAtMTMtMDI2MDM2LTMvNDA5 Chapter 18 of Core Python Programming] discusses GUI Programming with Tkinter
* [http://docstore.mik.ua/orelly/other/python2/ Programming Python, 2nd Edition, Chapter 7 and 8]
* [http://docstore.mik.ua/orelly/other/python2/ Programming Python, 2nd Edition, Chapter 7 and 8]
Line 27: Line 72:
* [http://www.pythonware.com/library/tkinter/introduction/ Original 'An introduced to Tkinter'] by Fredrik Lundh
* [http://www.pythonware.com/library/tkinter/introduction/ Original 'An introduced to Tkinter'] by Fredrik Lundh


Other options:
==Building Web Applications==
* Uses [http://www.fltk.org/ FLTK], the Fast Light Toolkit
You basically have two options:
* Write a CGI script (slow, but easy)
* Some sort of [https://en.wikipedia.org/wiki/Web_Server_Gateway_Interface Web Server Gateway Interface] (WSGI)
* See also https://wiki.python.org/moin/WebFrameworks


==Python Training==
Examples and resources:
I've seen these and highly recommend them:
* https://github.com/MichaelPereira/webhooks-demo-application
* [http://video.google.com/videoplay?docid=7760178035196894549 Advanced Python or Understanding Python], Thomas Wouters, Google Tech Talks, February 21, 2007.  
* https://mattcarrier.com/flask-dreamhost-setup/
* https://www.byteconsole.com/get-flask-up-and-running-on-a-dreamhost-server-with-passenger/


===To Watch===
===WSGI options===
I haven't seen these yet:
* Flask (can run on Apache with Passenger, but needs its own domain name)
* [http://pycon.blip.tv/#2032214 PyCon 2009 Videos]
* CherryPy
* [http://video.google.com/videoplay?docid=7760178035196894549#docid=-8437473245141752362 Python 101], PyCon 2011
* [http://video.google.com/videoplay?docid=7760178035196894549#docid=9023849479319414382 Introducing Python], 24 minutes of interviews.
; Python 3.0 training:
* [http://www.youtube.com/watch?v=Qi13Hot6IQw Python 3 tutorial - String formatting and conditions]
* [http://www.youtube.com/watch?v=2uO-sJKCNDo Python 3 Tutorial: Variables and Strings]
* [http://www.youtube.com/watch?v=jECazLigEH8 Python 3 Tutorial: 3 - Strings]
* [http:/www.youtube.com/watch?v=v6nD8f-J_XU Python 3 Tutorial: 17 - String Methods]
* [http://www.youtube.com/watch?v=geoly0UNCvA Ira Krakow's Python 3 Tutorial Part 2 (Strings)‏]
* [http://www.youtube.com/watch?v= fc9buLUiqLE Ira Krakow's Python 3 Essential Training --- Splitting and...‏]


===Printed Materials===
===Notes on Flask===
* [http://diveintopython3.org/ Dive Into Python 3] (book)
    $ 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==
==Python Installation==
If you are using a Mac, you almost certainly want to ditch Apple's python implementation and instead install your own from:
If you are using a Mac, you almost certainly want to ditch Apple's python implementation and instead install your own.
* http://www.python.org/download/releases/
 
I now recommend the [https://www.anaconda.com/ Anaconda Python distribution], because it has almost everything that you need, and it's easy to add new modules.


If you want everybody to be able to use your GUI, you probably want to write it in Tkinter (Python's Tcl/Tk bindings). If you want to actually enjoy what you are writing, you want to use wxpython.
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..


On the Mac, you can install matplotlib with this command using MacPorts::
  % sudo port install py-matplotlib py-ipython
[[Category:Resources]]
[[Category:Resources]]

Revision as of 18:30, 1 September 2018

For Learning Python

I've reviewed these resources and highly recommend them:

Data Representation

Numerical Datas

  • numpy - numeric analysis in python (needed for matplotlib)
  • tabulate - create tables easily
  • jupyter notebook

Date Data

String Formatting

Text Processing

See Text processing notes.

Graphing, Graphics and Games

Graphing

Easy Graphics

Games

Image Manipulation

  • Use Pillow, the Python2/3 fork of Python Image Library (PIL).

Fun examples:

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

Building Web Applications

You basically have two options:

Examples and resources:

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

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