WorldViz User Forum

WorldViz User Forum (
-   Vizard (
-   -   EXE creating a new folder (

mshukun 09-19-2014 10:05 AM

EXE creating a new folder
I have a problem creating a folder after compiling the code. The code below (1) creates the 'output.wav' file in the same directory as exe file. However, I would like to create "recording" folder to store the 'output.wav' file when the folder doesn't exist. How can I achieve it?

Thank you in advance.

(1) viz.res.getPublishedPath('output.wav')


# This code doesn't work after creating exe file.
curDir = os.path.dirname(os.path.realpath(__file__))
                recfileDir = os.path.join(curDir, "recording")
                if not os.path.exists(recfileDir):

farshizzo 09-19-2014 10:25 AM

You can use the viz.res.getPublishedPath command to determine the EXE execution path. You can use this to create files and subfolders. Here is an example:

# Get and create recording directory
recordingPath = viz.res.getPublishedPath('recording')
if not os.path.isdir(recordingPath):

# Output file to recording directory
outputPath = os.path.join(recordingPath,'output.wav')
with open(outputPath,'wb') as f:

mshukun 09-23-2014 06:40 AM

Thank you so much!! It worked perfectly!!


All times are GMT -7. The time now is 03:11 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2022, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC