WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-01-2008, 11:59 AM
Jerry Jerry is offline
Member
 
Join Date: Jun 2004
Posts: 105
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?
Reply With Quote
  #2  
Old 03-03-2008, 09:46 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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')
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
displayhtml did not work after published as EXE felixchc Vizard 5 10-18-2006 01:33 AM
csv reading kgarr Vizard 1 02-27-2006 12:02 PM
A simple Plug_in for reading data from serial port sled Plug-in development 0 08-12-2003 09:52 AM


All times are GMT -7. The time now is 05:38 AM.


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