how to get the path of a module (myself) ?
vlastimil.brom at gmail.com
Tue Jun 2 11:11:30 CEST 2009
2009/6/2 Stef Mientki <stef.mientki at gmail.com>:
> and the files generated by Py2Exe, don't work at all.
> Through this discussion, I discovered another problem,
> because __file__ isn't the current file,
> I can't run 1 module(file) from another module (file) .
There are already answers regarding other more topical issues with
the initial problem; but just in case the main problem would be the
use of __file__ ...
It seems, that the exe files generated from py2exe don't recognise
sometimes I used code like
except NameError: # py2exe
__file__ = sys.path
cf. e.g. http://mail.python.org/pipermail/python-list/2001-May/085384.html
I'm not sure, whether there are any drawbacks, but it works in the
respective context (accessing text and image files in parallel
More information about the Python-list