It works now.
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
Is there a way to get a relative or absolute path to a python file once
it's been imported as a module?
For example, I type:
>>> import filegen
and I want a string that represents the path to filegen.py (either
relative to current working directory or the absolute path)
--
http://mail.python.or