Tuesday, November 25, 2008

A better way to create your own python path

When we program we have to create our own module,sometime we just want to test some feature,and then write a series of .py file.We want to use them conveniently.So I think a better way to do this is create a .pth file,then save it in the top level of python program.For example:
we create a file mypath.pth,then save it into c:/python25
edit this file like:
D:\my-python-module\

Then when we put new .py file in this folder, we can reuse them as they are the standard python module.

No comments: