IDE
- Eclipse with PyDev
- Mint 13 has version 3.7.2, current is 4.2 (1/20/2013)
- http://pydev.org/manual_101_install.html
- Python Anywhere
Modules
- setuptools
- Linux Mint Software Manager has package for Python 2 and 3
- OAuth2
- Need to install setuptools module first
- Download and extract zip from https://github.com/simplegeo/python-oauth2
-
sudo ./setup.py install
- Consuming Twitter’s Streaming API using Python and cURL
Tutorials
- Good python tutorial
List properties of an object/class
-
dir(a)
-
a.__dict__
-
help(a)
- displays docstrings
python-oauth2
- https://github.com/simplegeo/python-oauth2
-
import oauth2 as oauth consumer = oauth.Consumer('consumer-key-here','consumer-secret-here') token = oauth.Token('access-key-here','access-key-secret-here') client = oauth.Client(consumer, token) response, content = client.request('http://someservice.com/api/something/')
- Make a post call:
-
import urllib response, content = myclient.request("http://someservice.com/api/something/", \ method="POST", body=urllib.urlencode({'name': 'value', 'another_name': 'another value'}) )
-
Version
-
import sys print sys.version_info
MySQL
- From MySQL: http://dev.mysql.com/doc/connector-python/en/index.html
- From package: python-mysqldb http://mysql-python.sourceforge.net/