Re: path to python file given module

2005-01-09 Thread Gene
It works now. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: path to python file given module

2005-01-09 Thread Steve Holden
Gene wrote: that method doesn't seem to work as well on UNIX: wla apocalypse[94] ~/filegen > ls filegen.py OLDwla_csv2objects.py wlaclasses.py filegen.pyc templates/ wlaclasses.pyc gen_all_from_csv.py test.py* wla apocalypse[95] ~/filegen > python Us

Re: path to python file given module

2005-01-09 Thread Kartic
That is because your module in not in a standard location that python can find it in. It is not that inspect.getsourcefile() is not working. Actually if you try reloading your filegen module after the os.chdir(), you will see that import fails. If you copy your filegen directory to the site-packag

Re: path to python file given module

2005-01-09 Thread Gene
that method doesn't seem to work as well on UNIX: wla apocalypse[94] ~/filegen > ls filegen.py OLDwla_csv2objects.py wlaclasses.py filegen.pyc templates/ wlaclasses.pyc gen_all_from_csv.py test.py* wla apocalypse[95] ~/filegen > python ... >>> import fil

Re: path to python file given module

2005-01-09 Thread Kartic
Try this:; >>> import filegen >>> import inspect >>> print inspect.getsourcefile(filegen.SomeClass) 'C:\\Python23\\Lib\\site-packages\\filegen\filegen.py' Cheers, --Kartic -- http://mail.python.org/mailman/listinfo/python-list