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: Code:
dir = os.getcwd() Code:
if hasattr(sys, 'frozen'): Is there any way around this? |
I should also mention that the if-statement in the second block of code isn't even evaluated to be true, since a .py script is technically still being interpreted. The sys module is not frozen.
|
You can use the viz.res.getPublishedPath command to get the directory of the published executable.
|
Worked perfectly, thank you very much!
|
All times are GMT -7. The time now is 12:04 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC