py2exe 0.5.0 and data_files

Josiah Carlson jcarlson at nospam.uci.edu
Fri Mar 19 18:44:45 EST 2004


Try the following...

ex_name = 'myprogram.exe'

if sys.path[0][-len(ex_name):] == ex_name:
     path = os.path.split(sys.path[0])
else:
     path = os.path.split(__file__)

I don't know if the above works correctly when the script is not a part 
of an executable, but is imported with zipimport.

  - Josiah



More information about the Python-list mailing list