Hi all,

Let's say I have a script called bob.py in a directory called
c:\pythonstuff, which is in my PATH env_var, and python is also in my
PATH, and from a completely different directory I call "python bob.py"
is there a right way to determine what directory bob.py resides in?

So far I've found that

import inspect

class Foo:
        pass

sourceP = inspect.getsourcefile(Foo)

works, but I'm not too sure how resilient that is...

Regards,

Liam Clarke
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to