WorldViz User Forum  

Go Back   WorldViz User Forum > Precision Position Tracker (PPT)

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 04-27-2016, 02:43 AM
rajnishv rajnishv is offline
Member
 
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("script.py",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



viz.setMultiSample(4)
viz.fov(60)
viz.go()

piaz=viz.add('dojo.osgb')

#subprocess.call("pyOne.py", shell=True)

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

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


#if __name__ == '__main__':
#subprocess.call("pyTwo.py", 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




viz.setMultiSample(4)
viz.fov(60)
viz.go()

piaz=viz.add('dojo.osgb')

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

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




#vizact.ontimer(1,changeExitTwo)
viz.callback(viz.KEYDOWN_EVENT, changeTwo)

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


Pls suggest me
Reply With Quote
  #2  
Old 04-27-2016, 03:25 AM
rajnishv rajnishv is offline
Member
 
Join Date: Jan 2016
Location: Kalina,Sanatcruz(East),Mumbai,Maharashtra,India
Posts: 94
Regarding sript swith and close the previous script

Hi jeff,
I have 4 Scripts with theie different vizconnects,
I m calling a script using a subprocess module -subprocess("script.py",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 :


I m testing on the keyboard event(same can be applied to wand event0
for ex:
1st script:

import os
import vizinfo
import sys
import viz
import subprocess



viz.setMultiSample(4)
viz.fov(60)
viz.go()

piaz=viz.add('dojo.osgb')

#subprocess.call("pyOne.py", shell=True)
def changeExitTwo(ce):
print 'change two exit'
subprocess.call("pyTwo.py", shell=True)
if __name__ == '__main__':later( )

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


#if __name__ == '__main__':
#subprocess.call("pyTwo.py", shell=True)
#later( )
viz.callback(viz.KEYDOWN_EVENT, changeExitTwo)


#------------------------2nd Script------------------------
2nd script




import viz
import vizshape
import vizact
import os
import vizinfo
import sys

import subprocess




viz.setMultiSample(4)
viz.fov(60)
viz.go()

piaz=viz.add('gallery.osgb')


def changeTwo(word):
print 'I m in pyTwo to exit pYone and call pyThree'
subprocess.call("pyThree.py", shell=True)
##Rest of code to call third script here and exit the second one



viz.callback(viz.KEYDOWN_EVENT, changeTwo)

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

Pls ignore my last post.
Pls assit me for the following.
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
Window always on top madeinjava Vizard 4 08-27-2013 02:10 PM
winviz in Vizard 4and displaying a console window Enlil Vizard 2 02-22-2012 02:35 PM
How to make a glass window in Vizard Frank Verberne Vizard 9 07-27-2011 03:47 PM
Vizard 4 Beta Testing farshizzo Announcements 0 02-01-2011 10:46 AM
Vizard tech tip: Using the Python Imaging Library (PIL) Jeff Vizard 0 03-23-2009 11:13 AM


All times are GMT -7. The time now is 04:04 PM.


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