WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Reading in parameters with a published exe (https://forum.worldviz.com/showthread.php?t=1370)

Jerry 03-01-2008 11:59 AM

Reading in parameters with a published exe
 
I have a script which reads parameters in from a text file. This is so that
the user can modify the parameters in the file without having to
run Vizard and modify them in the script.

The problem is that when I publish the script to an exe the modified parameter
file is no longer read. It always uses the values of the parameters in effect
when the script was published.

Is there any way to make a published exe read in parameters from a file
when it runs?

farshizzo 03-03-2008 09:46 AM

Is the input file in the same directory as the EXE? If so, you can use the viz.publish.path option to get the path to the EXE, and prepend it to the filename. Example:
Code:

filename = 'input.txt'

#Prepend publish path to filename
if int(viz.getOption('viz.publish',0)):
        filename = '/'.join([viz.getOption('viz.publish.path'),filename])

f = open(filename,'r')



All times are GMT -7. The time now is 11:26 PM.

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