-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython
More file actions
16 lines (11 loc) · 1.03 KB
/
python
File metadata and controls
16 lines (11 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# how to figure out where a module's source code lives (e.g. boto)
>>> import boto
>>> dir(boto)
>>> print boto.__path__
['/usr/local/lib/python2.7/dist-packages/boto']
# figure out what python's PATH for imports is
>>> import sys
>>> print sys.path
['', '/usr/local/lib/python2.7/dist-packages/s3funnel-0.6.5-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/workerpool-0.9.2-py2.7.egg', '/mnt/common', '/mnt/moatbot', '/mnt/mqueue', '/mnt/scrapepipeline', '/mnt/swfshots', '/mnt/tagpipeline', '/usr/local/lib/python2.7/dist-packages/distribute-0.6.34-py2.7.egg', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/local/lib/python2.7/dist-packages/PIL', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode']
# how the fuck do generators/yield work?
# take a look at: notes/generators.py