View Single Post
Old 04-27-2016, 03:43 AM
rajnishv rajnishv is offline
Join Date: Jan 2016
Location: Kalina,Sanatcruz(East),Mumbai,Maharashtra,India
Posts: 94
Smile reagrding closing the output window console of vizard

Hi jeff,
I have 4 Scripts with theie different vizconnects,
I m calling a script using a subprocess module -subprocess("",shell=True)

The 1st script executed on an event from wand executes a second script,but the 1st script is not closed,and so on.
I want when i start or executes a new script,which terminated the previous console output window.
The are four scripts..

launch 1st script...
call secnd script from 1st script-2nd oupt console opened ,the first output console should get closed and the same for 2nd,3rd and 4th .
I have tried:
sys.exit(),os.exit() and others :

for ex:
1st script:

import os
import vizinfo
import sys
import viz
import subprocess


piaz=viz.add('dojo.osgb')"", shell=True)

def changeExit(ce):
print 'change two exit'"", shell=True)
if __name__ == '__main__':later( )

def later( ):
import sys
print 'Bye sys world'
print 'Never reached'

#if __name__ == '__main__':"", shell=True)
#later( )
viz.callback(viz.KEYDOWN_EVENT, changeExit)

#---------------------new 2nd script------------
2nd script:
import viz
import vizshape
import vizact
import os
import vizinfo
import sys

import subprocess



def changeExitTwo():
print 'Exitted the pyOne'
sys.exit('pyTwo Died')
#raise SystemExit

def changeTwo(word):
print 'I m in pyTwo to exit pYone and call pyThree'"", shell=True)
import pyOne as p

viz.callback(viz.KEYDOWN_EVENT, changeTwo)

if __name__ == '__main__':
print 'Rajnish Vishwakarma'

Pls suggest me
Reply With Quote