From: Bruce S. <Bru...@nc...> - 2009-07-03 05:44:51
|
A somewhat distinctive feature of VPython is that there is no exit when you reach the end of a program such as from visual import * sphere() The reason of course is that you may be viewing the scene and spinning or zooming. However, as you imply, if your program has finished and there is no scene to be viewed, VPython should exit. A separate issue is how to programmatically exit a program. I thought there was a way using sys.exit(), but that doesn't work (doesn't seem to work in Visual 3, either). Bruce Sherwood Michele Mattioni wrote: > Hello list, > > I'm trying to figure out how to close visual from the code and not > from the GUI, 'cause I need this feature. > > Consider the following code: > > > import visual > import time > scene = visual.display() > cyl = visual.cylinder() > time.sleep(3) > scene.visible = False > > > if you run it with > > python test.py > > the command line keeps to be busy and the prompt never show up. > This does not happen if I click on the x on top of the gui. > > I'm missing some bit? > > Regards, > Michele. > > ------------------------------------------------------------------------------ > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > |