wbrack Report post Posted 05/18/2004 08:12 AM When using a Run Module to execute a python script (which has no trouble running "standalone" the module fails. The logfile shows: 155915.78 0 TimeoutClear 155915.80 0 [Get Account List] Run Program 155915.80 0 RVreplace start: [python Scripts\gAcList.py $RV_LINEID $RV_CIDNUMBER] 155915.80 0 RVns [PathSysVoice]{}[PathApp]{C:\Program Files\VoiceGuide\}[PathDataVm]{C:\Program Files\VoiceGuide\data\}[PathVgSys]{C:\Program Files\VoiceGuide\system\}[$RV_STARTTIME]{5/18/2004 3:59:10 PM}[$RV_DEVICEID]{0}[$RV_CIDNAME]{}[PathApp]{C:\Program Files\VoiceGuide\}[$RV_CIDNUMBER]{27100587}[Eval CID_Input]{27100587 > 0}[Eval CID]{True} 155915.80 0 RVreplace end: [python Scripts\gAcList.py 0 27100587] 155915.80 0 running:[python Scripts\gAcList.py 0 27100587] WindowMode:[NormalFocus] 155915.80 0 Run Program waiting... (shellid=1020, process=524) 155915.80 0 [Get Account List] Playing (Soundfiles\The Microsoft Sound.wav) 155916.09 0 PlaySoundStart ok [C:\Program Files\VoiceGuide\Projectx\Soundfiles\The Microsoft Sound.wav] 155916.09 0 TimeoutClear 155916.09 0 TimeoutSet 1 EV_TIMEOUT_CHECKONSTATE 155916.09 0 wa(6133,91245300) 155917.19 0 Timer fired EV_TIMEOUT_CHECKONSTATE 155917.19 0 ScriptEventCode 9007 iLineState=1501 155917.19 0 LsRunWaitTillFinished EV_TIMEOUT_CHECKONSTATE 155917.19 0 task completed (shellid=1020, process=524) 155917.19 0 No information returned from program to VG (no VGRUNRESULT_0.TXT or SHLRESLT.TXT) How can I change the "TimeoutSet 1 EV_TIMEOUT_CHECKONSTATE" to be a longer value? Share this post Link to post
SupportTeam Report post Posted 05/18/2004 08:42 AM I suspect that the python program never even starts as you have not specified the full path to python.exe and the script which it is to execute. Please specify full paths for both and I think you'll see your program starting correctly then. Share this post Link to post
wbrack Report post Posted 05/20/2004 02:45 PM Just for "closure", I finally got the scripts working today. Your suggestion on paths was necessary (for the script, but not for python which is on the "system path" on my systems), but not quite sufficient. In the hopes that it may be useful to someone else in the future, here's what I went through. The problem arises because the "home directory" from which the script is run (by VG) is not obvious, and (even worse) is not consistent. It varies between Windoze OS's (WinME tends to run the script in \Windows\Desktop, while Win2K sometimes runs it from the VG home directory, and sometimes from "somewhere else" (I never did determine where that is). The Win2K choice seems to be random, although it may depend upon the phase of the moon, or possibly the relative humidity. The script's "home directory" problem leads to the real "show-stopper". In order for the script to indicate "success" to VG, it's necessary to produce a results file (in my case I needed to produce VGRUNRESULTS_{line-id}.TXT, and that file *must* be placed where VG expects it, in the VG "application home directory". So, in order to produce the "right" filename in the "right" directory, the script must be written to accept the information from the command line, and the Run Module must include the information when the script is called, e.g. \python23\python \path-to-script\myscript.py "$RV_VgPath" $RV_LINEID Note the quotes around $RV_VgPath - since the path may contain spaces (e.g. C:\Program Files\VoiceGuide), if they aren't present it will look (to the script) like two different variables (that little fact cost me more debugging time than I care to admit to the world). Then, in the Python script, the results may be written out with something like: import sys ...... resPath = '%s\\VGRUNRESULTS_%s.TXT' % (sys.argv[1], sys.argv[2]) res = open(resPath, 'w') res.write('[scriptResult]{OK}') res.close Now it all seems to be working, and I'm quite pleased with the functionality which is provided by this interface. Most of my scripts communicate (via IP) with a separate server system, and the ability to manipulate the data, then communicate it back to VG via result variables, gives great results. Share this post Link to post
SupportTeam Report post Posted 05/20/2004 09:08 PM Thanks for letting everybody know how the problem was resolved. Just to clarify: the "Results File" (vgrunresult_X.txt) should be placed in either the VoiceGuide script's directory, or alternatively in VoiceGuide's directory itself. These days a quicker and much less messy way of returning data to VoiceGuide is by using the Run_ResultReturn COM function. See: http://www.voiceguide.com/vghelp/html/com_...esultReturn.htm Share this post Link to post