WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   problems with output to a text file within executable (https://forum.worldviz.com/showthread.php?t=2126)

Saz 07-01-2009 06:05 AM

problems with output to a text file within executable
 
Hi,

I'm having trouble getting my data when my program is published as an executable. When developing the code this:
Code:

#Get path to publish EXE
path = viz.getOption('Y:\backup\Vizard30\resources\road\speed_.txt','.')+'/'

#Open file in path
file = open( 'adapt' + str(subject),'w' )

worked fine - but didn't work at all when published as an executable.

Previously I've gathered data using this:
Code:

directory = 'Z:\Vizard30\Dataoutput\driving\ '
subjectd = 'speed_.txt' + str(subject)
filename = directory+subjectd
file = open(filename, 'w')

which again seems to have stopped working.

I've tried this:
Code:

def getPublishedPath(filename):
        filename = 'adapt_.txt' + str(subject)
        publishPath = viz.getOption('Y:\backup\Vizard30\resources\road\','')
        if publishPath:
                return '/'.join([publishPath,filename])
        return filename

file = open(getPublishedPath(filename), 'w')

but I get an error message with it.

Any ideas on what I should be doing?
Cheers!

Jeff 07-01-2009 11:01 AM

Take a look at the following thread. There's some sample code in one of farshizzo's posts.

http://forum.worldviz.com/showthread.php?t=715


All times are GMT -7. The time now is 10:18 AM.

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