RE: [Edu-sig] Re: Teaching graphics with Python

But getting it down to its essentials, the following runs, and provides a sphere primitive that insists on being blue.
Just upgraded to the latest VPython and tested your code (in Windows so far, will move to Linux box next). Works great. Wondering where you're getting this info re atexit, for example, given there's no documentation. From digging in the source code you say?
import cvisual
Had to change the above to: import visual.cvisual as cvisual # (just a path issue)
import time import atexit
def __waitclose(): while not cvisual.allclosed(): time.sleep(0.05) atexit.register(__waitclose)
scene = cvisual.display()
class sphere (cvisual.sphere): def __init__( self,*args,**keywords): cvisual.sphere.__init__(self) self.color=(0,0,1)
self.color=(160/255.,32/255.,240/255.) # Purple!
self.complete_init( self, self, 1, scene, None)
scene.background = (1,1,1) # white background anyone?
s=sphere()
It's great to be able to finally do this VPython stuff interactively in the native IDLE without problems (at least for the most part). The Download page is more explicit now about what the default install will do, e.g. overwrite any existing Numeric with version 23.0, plus mentions how to get back to where Python default boots to a shell, not to the editor (my preference, easily restored). Kirby

import cvisual
Had to change the above to:
import visual.cvisual as cvisual # (just a path issue)
Thanks for that. I was running my test from the visual directory, so didn't catch this.
The Download page is more explicit now about what the default install will do, e.g. overwrite any existing Numeric with version 23.0, plus mentions how to get back to where Python default boots to a shell, not to the editor (my preference, easily restored).
Less easily, in my case. I had an existing config-main.cfg file in my .indle-rc directory. VPython chooses to overwrite the core config-main.def file in the idlelib directory. That the VPython distribution chooses to overwrite the config-main.def file, rather than work within the framework designed within Idle - for projects like VPython - for custom configuration (config-main.cfg in .idlerc of the users home directory) is = to me - bad attitude. But nothing new, when it comes to Vpython distribution issues. The solution to get back to the interactive shell on start-up suggested by VPython is actually creating a user configuration file (config-main.cfg in .idlerc) For reasons unknown, the change to restore the default was not writing to my existing user configuration file. I was dead-in-the-water if I did not know enough about how Idle configuration files work to fix this manually. The other things that were "fixed" - like mentioning Numeric in the "VPython includes" blurb of the main web page - I have to assume is not unrelated to my rantings. Perhaps some ranting will help Bruce to decide to play ball with how the Idle customization is achieved. Art
Kirby
_______________________________________________ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig

-----Original Message----- From: edu-sig-bounces@python.org [mailto:edu-sig-bounces@python.org] On Behalf Of Kirby Urner Sent: Sunday, August 01, 2004 11:08 PM To: edu-sig@python.org Subject: RE: [Edu-sig] Re: Teaching graphics with Python
Wondering where you're getting this info re atexit, for example, given there's no documentation. From digging in the source code you say?
I didn't have to go as far as to dig into the C++ source, for this. I derive it from the __init__.py module in the visual directory. VPython itself can now reasonably be viewed as a wrapper around the cvisual code. Bruce Sherwood had, in essence, suggested this view himself at one point, and I think I will try to adapt it. Since it is the cvisual core that I admire, written by David Scherer, and revised by Jonathan Brandenmeyer (with funding engineered by Bruce). One advantage of wrapping cvisual myself for PyGeo will be to allow me to distance it from what I perceive as the VPython attitude problems. The practical advantage is allowing people to avoid a VPython download, and handle things - like IDLE customization - in a manner I find appropriate and compliant. If it means I don't get things as I might most wish from start-up for my users without some instruction to them as to configuration issues - well that is quite often the case when trying to be appropriate and compliant. And I generally see that understood, accepted, respected and worked with. Though I feel almost certain others might find all this verbiage a result of attitudes problem of my own - I obviously don't. Art
participants (2)
-
Arthur
-
Kirby Urner