saving local dir

B

Bengt dePaulis

I just started on python.

I have c:\python23\examples\py
and want to include that in my sys.path

How to do it permanently?

/Bengt
Helsinki
 
P

Peter Hansen

Bengt said:
I just started on python.

I have c:\python23\examples\py
and want to include that in my sys.path

How to do it permanently?

In addition to Tim's suggestion, you can also use
".pth" files, as documented primarily in the comments
at the top of c:\python23\lib\site.py.

I find this a cleaner approach than PYTHONPATH,
though the latter might be better for one-shot
situations where you want to affect only one console
window and all future ones.

(In a nutshell, create a file called somename.pth,
being careful to use a *lowercase* .pth instead of .PTH,
and stick it in c:\python23. Put the paths that
you want in sys.path into that file, one per line,
such as "c:\python23\examples" without the quotes...)

-Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,209
Messages
2,571,089
Members
47,689
Latest member
kilaocrhtbfnr

Latest Threads

Top