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:
Code:
# Get and create recording directory
recordingPath = viz.res.getPublishedPath('recording')
if not os.path.isdir(recordingPath):
os.makedirs(recordingPath)
# Output file to recording directory
outputPath = os.path.join(recordingPath,'output.wav')
with open(outputPath,'wb') as f:
f.write('')