View Single Post
Old 06-16-2011, 09:38 AM
kevin kevin is offline
Join Date: Jun 2011
Posts: 18
Current working directory in Vizard Executable

Hi all,

I'm building an executable in Vizard which at one point brings up a file browser, and I was hoping that the starting directory for this browser could be in the same directory as the executable being run. However, it seems that when Vizard publishes an .exe, it merely creates a wrapper around the python script which was being published. That script and the other necessary files (.pycs, etc) are then loaded into the AppData/Local/Temp folder of the current user, and so code like:

dir = os.getcwd()

if hasattr(sys, 'frozen'):
	dir = os.path.dirname(sys.executable)
only give me the directory for the Temp folder, rather than the directory of the actual executable file being run.

Is there any way around this?
Reply With Quote