<div dir="ltr">For the record, I do not know of any evidence whatsoever for a supposed "split" between the tiny VPython community and the huge Python community concerning floating point variables. Nor do I see anything in Python that needs to be "fixed".<div>
<br></div><div>The new (currently experimental) version of VPython based on wxPython must, in order to run in a Cocoa environment on the Mac, make the interact loop be the primary thread, with the user's Python calculations at worst a secondary thread, which is the opposite of the older VPython, where the interval-driven rendering thread was secondary to the user's calculations. By the unusual stratagem of having VPython import the user's program it has been possible to make this work, and at the same time greatly simplify the C++ component of VPython by eliminating threading, with additional important simplification from eliminating essentially all platform-dependent code thanks to the multiplatform character of wxPython. The result is that nearly all existing VPython programs will work without change, at the very small cost of a few marginal cases requiring minor tweaking. I should alter the documentation to make this important property of the new version more salient.</div>
<div><br></div><div style>Minor point: The meaning of the new VPython "sleep" is precisely to relinquish control to the OS, including the GUI. During sleep one wants the wxPython window controls to remain active, which will not be the case with time.sleep, which knows nothing about the wxPython interact loop. So I think the meaning of "sleep" is the usual meaning.</div>
<div><br></div><div style>Bruce Sherwood</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Jan 13, 2013 at 9:13 AM, Mark Janssen <span dir="ltr"><<a href="mailto:dreamingforward@gmail.com" target="_blank">dreamingforward@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Sun, Jan 13, 2013 at 1:15 AM, Bruce Sherwood <<a href="mailto:Bruce_Sherwood@ncsu.edu">Bruce_Sherwood@ncsu.edu</a>> wrote:<br>
</div><div class="im">> Here is detailed information on how VPython 6 differs from VPython 5, which<br>
> will be incorporated in the Help for upcoming releases of VPython 6. Note<br>
> that the fact that in a main program __name__ isn't '__main__' is an<br>
> unavoidable "feature", not a bug. That is, there doesn't seem to be a way to<br>
> make this work.<br>
<br>
</div>Hi, Bruce. I think there are two ways of fixing this. One is to get<br>
down to the C language level, and share the C main() loop, which will<br>
percolate back up into the CPython loop. The other involves mending<br>
the split that I've been mentioning that happened over floating point<br>
between the VPython developers and the Python-dev group. Then perhaps<br>
Guido will accept VPython using/sharing the __main__ "loop". (I'm<br>
CC'ing him in this message.) So, either of these tracks should fix<br>
this problem. This is why I keep mentioning the important of healing<br>
that split between the parties arguing in the two camps. Perhaps Tim<br>
Peters will be able help bridge this gap.<br>
<div class="im"><br>
> Changes from VPython 5<br>
><br>
> The new version makes an essential change to the syntax of VPython programs.<br>
> Now, an animation loop MUST contain a rate or sleep statement, which limits<br>
> the number of loop iterations per second as before but also when appropriate<br>
> (about 30 times per second) updates the 3D scene and handles mouse and<br>
> keyboard events. Without a rate or sleep statement, the scene will not be<br>
> updated until and unless the loop is completed.<br>
<br>
</div>I think this is perfectly acceptible and is just a necessary<br>
restriction wherefrom the OS *must* maintain ultimate control of I/O.<br>
Python sits in userspace surrounded by the larger computation<br>
environment, so this is only fair that an OS call is made so that it<br>
can keep things in "check". Naming it "sleep" is okay, but makes it<br>
sound more like a voluntary thing, and as you probably know, is the<br>
traditional name for relinquishng some control to the OS. (cf. Unix<br>
Systems Programming, Robbins, et al.)<br>
<div class="im"><br>
> You should use the new function sleep rather than time.sleep. The new<br>
> function periodically renders the scene and processes mouse events, making<br>
> it possible to continue using zoom and rotate, whereas time.sleep does not<br>
> do this.<br>
<br>
</div>This is strange to me. I think this is where VPython must be ahead of<br>
the curve and not close enough to the Linux development communities.<br>
<div class="im"><br>
> For technical reasons, it is necessary for VPython 6 to do something rather<br>
> unusual. When you import visual (or vis), your own program is in turn<br>
> imported by the visual module.<br>
<br>
</div>Again this is because of the faction that was created by in 200?,<br>
regarding the Vpython community vs. the python-dev. Really, this<br>
should be mended.<br>
<br>
Anyway, I hope that any of this made sense.<br>
<br>
Thanks for your help!<br>
<span class="HOEnZb"><font color="#888888"><br>
Mark<br>
</font></span></blockquote></div><br></div>