Vizard 7 » Command Index » Vizard modules » viz » <viz:res>.getPublishedPath
7.7

<viz:res>.getPublishedPath

Returns full path of file in published EXE directory

<viz:res>.getPublishedPath(  
filename = ''  
)  
filename = ''
Filename in published EXE directoy

Remarks

This command will return the full path of the specified file by prepending the publish EXE path to the filename. If the script is not running as a published EXE, then the unmodified filename will be returned.

Return Value

File path

Example

# Log output data to same path as published EXE
filename = viz.res.getPublishedPath('output.log')
with open(filename,'w') as f:
    f.write('some output')

See also

<viz:res>.addPublishDirectory
<viz:res>.addPublishFile
<viz:res>.addPublishFileLoader
<viz:res>.addPublishFilter
<viz:res>.addPublishImageLoaders