Friday, December 28, 2012

Py2exe Issues

When getting the directory of the file you're executing in python use the correct example:

CORRECT: os.path.abspath(os.path.dirname(sys.argv[0]))
INCORRECT: os.path.dirname(inspect.getsourcefile( lambda:None ))

If you're using py2exe, the incorrect example will just give error messages.

No comments:

Post a Comment