replacement for __file__ in compiled exe

TechieInsights GDoermann at gmail.com
Mon Jan 5 15:03:24 EST 2009


__file__ command does not work when compiled to exe.  It makes since
because the file is now in a compressed library.  Is there a
replacement or something else you can do?  The real problem is that
when you create an exe of your program with python embedded, you can't
always guarantee that your current directory is the directory of your
program.  I guess when you could just set a registry entry on
windows... but it would be nice to have a quick fix for this (like
os.path.dirname(__file__)).

Thanks,

Greg



More information about the Python-list mailing list