13 Feb
2007
13 Feb
'07
1:15 p.m.
--On 13. Februar 2007 13:10:17 +0000 Alan <alanwilter@gmail.com> wrote:
Thanks Andreas, I am trying with:
if sys.path.count(myPath) == 0: sys.path.insert(0, myPath)
What's the sense of this code? sys.path is usually *never* empty. You should really look at the Python docs and learn where Python is looking by default for modules. Is is perfectly documented -> python.org -> documentation. In addition you would like to check for the existence of an item in sys.path using if myPath in sys.path: -aj