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]
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