Re: How to - import code not in current directory

2005-11-17 Thread py
Claudio Grondi wrote: > so this should work in your case: > > import sys > sys.path.append("C:\some\other\directory") > import bar ...that will certainly work. Only issue is that each time I start up foo.py in the python shell I have to retype those three lineskind of why I was hoping for a e

RE: How to - import code not in current directory

2005-11-17 Thread Dmytro Lesnyak
Yes, you can. Try this: import sys sys.path.append('c:\some\other\directory\') import bar Good luck! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of py Sent: 17. marraskuuta 2005 15:19 To: python-list@python.org Subject: How to - import code not in cur

Re: How to - import code not in current directory

2005-11-17 Thread py
PYTHONPATH is perfectcheck out this link for more info.. http://docs.python.org/tut/node8.html#searchPath I just added the environment variable (on windows) named "PYTHONPATH" and set it to "C:\some\other\directory" :) -- http://mail.python.org/mailman/listinfo/python-list

Re: How to - import code not in current directory

2005-11-17 Thread Claudio Grondi
This question seems to come up in this newsgroup quite often, so looking through past threads will sure provide more details. Here from "Re: how to import a module from a arbitraty path?" posted to comp.lang.python by Simon Brunning on May 26, 2005 09:20 : " > I have a program which is going to

Re: How to - import code not in current directory

2005-11-17 Thread Claudio Grondi
"py" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > Claudio Grondi wrote: > > so this should work in your case: > > > > import sys > > sys.path.append("C:\some\other\directory") > > import bar > > ...that will certainly work. Only issue is that each time I start up > foo.py in

Re: How to - import code not in current directory

2005-11-17 Thread Carsten Haese
On Thu, 2005-11-17 at 08:41, py wrote: > Claudio Grondi wrote: > > so this should work in your case: > > > > import sys > > sys.path.append("C:\some\other\directory") > > import bar > > ...that will certainly work. Only issue is that each time I start up > foo.py in the python shell I have to ret