Difference between revisions of "Python"

From Tmplab
(New page: = Intro = This cheat sheet helps troubleshoot common problems... = Problems = == I installed some modules / packages and can't load them == echo $PYTHONPATH $ python Python 2.5.2 (r...)
 
(Intro)
Line 1: Line 1:
 
= Intro =
 
= Intro =
 
This cheat sheet helps troubleshoot common problems...
 
This cheat sheet helps troubleshoot common problems...
 +
 +
= Tricks =
 +
Finding what's in an object
 +
>>> dir(obj)
  
 
= Problems =
 
= Problems =

Revision as of 20:42, 20 October 2009

Intro

This cheat sheet helps troubleshoot common problems...

Tricks

Finding what's in an object >>> dir(obj)

Problems

I installed some modules / packages and can't load them

echo $PYTHONPATH
$ python
Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53) 
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
for i in sys.path: 
    print i

You can add a .pth file in one of the already loaded dir: see http://djangotricks.blogspot.com/2008/09/note-on-python-paths.html