how to get the path of a module (myself) ?
gagsl-py2 at yahoo.com.ar
Wed Jun 3 07:32:03 CEST 2009
En Tue, 02 Jun 2009 06:11:30 -0300, Vlastimil Brom
<vlastimil.brom at gmail.com> escribió:
> [...] just in case the main problem would be the
> use of __file__ ...
> It seems, that the exe files generated from py2exe don't recognise
> this variable;
> sometimes I used code like
> except NameError: # py2exe
> __file__ = sys.path
I think you meant __file__ = sys.argv
> cf. e.g.
That's a rather old post. The "right" way to obtain a resource from a
package is using pkgutil.get_data(), and py2exe should support it by now.
(I haven't tested, but I think it does).
More information about the Python-list