WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   getting data out of an exe (https://forum.worldviz.com/showthread.php?t=2276)

mjabon 09-21-2009 09:32 PM

getting data out of an exe
 
Hello. I want to publish a script as an exe and it writes to a file. I want to have axcess to the data in that file after the exe is closed (ie I want it saved in the same folder the exe is stored).

How can I do this? Right now nothing comes out of the exe.

farshizzo 09-22-2009 10:58 AM

The documentation for Publishing as an EXE describes how to accomplish this. Specifically, you need to use the viz.res.getPublishedPath() command.

mjabon 09-22-2009 11:49 AM

Quote:

Originally Posted by farshizzo (Post 8714)
The documentation for Publishing as an EXE describes how to accomplish this. Specifically, you need to use the viz.res.getPublishedPath() command.

Right, but that just returns a string - the path of the file. It doesn't output the file.

farshizzo 09-22-2009 11:53 AM

Of course it doesn't, it's up to you to create the file using the new path and write to it:
Code:

f = open( viz.res.getPublishedPath('output.txt') , 'w' )
f.write('bla bla bla')
f.close()



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

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