Vpython close window

207 views
Skip to first unread message

Duim

unread,
Mar 23, 2010, 10:15:44 AM3/23/10
to spyder
When I'm trying out a simple vpython program and close the vpython
window, spyder also closes.

Is this a bug or should I modify my interactive python script (or
simply not use it in interactive mode).

code which shows the behavior:

(the bounce example):

[code]
from visual import *

floor = box(length=4, height=0.5, width=4, color=color.blue)

ball = sphere(pos=(0,4,0), color=color.red)
ball.velocity = vector(0,-1,0)

dt = 0.01
while 1:
rate(100)
ball.pos = ball.pos + ball.velocity*dt
if ball.y < 1:
ball.velocity.y = -ball.velocity.y
else:
ball.velocity.y = ball.velocity.y - 9.8*dt
[/code]

Pierre Raybaut

unread,
Mar 30, 2010, 8:08:39 AM3/30/10
to spyder
It's not really a bug and you should not have to modify your script
neither.

Actually it seems that the Visual pop-up window is sending a "exit"
signal to Python interpreter when it's closed. I guess that's why
VPython developers have been distributing a modified version of IDLE
(named VIDLE): they are certainly using a trick to avoid this in VIDLE
(if that's the case, I haven't checked yet).

Anyway, if you try the same thing in a standard Python interpreter, it
behaves the same way as Spyder -- so from this point of view, that is
not a bug!

I'll try and take a look at VIDLE to see if there's something to get
inspiration from for Spyder, so you may run your script without
modification.

Thanks for reporting this!
Cheers,
Pierre

Pierre Raybaut

unread,
Mar 30, 2010, 8:11:20 AM3/30/10
to spyder
I've just checked and it's not handled by VIDLE too.
I'll have to contact the developers to see what we can do.
Reply all
Reply to author
Forward
0 new messages