那天想加个python path 半天都弄不上。终于找到了一个详尽的guide粘在这里吧:
例如将/home/jim加入到python path中
第一步:
jim@jim-laptop:~$ sudo gedit /usr/lib/python2.6/dist-packages/a.pth
[sudo] password for jim:
第二步:在a.pth中编辑
import sys;
print'/home/jim installed'
/home/jim
第三步:
jim@jim-laptop:/usr/bin$ python
>>> import sys
>>> sys.path
['', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages', '/usr/lib/python2.6/dist-packages/PIL', '/home/jim', '/usr/lib/python2.6/dist-packages/gst-0.10', '/usr/lib/pymodules/python2.6', '/usr/lib/python2.6/dist-packages/gtk-2.0', '/usr/lib/p