From ajsiegel at optonline.net Sun Aug 1 16:21:05 2004 From: ajsiegel at optonline.net (Arthur) Date: Sun Aug 1 16:21:07 2004 Subject: [Edu-sig] Re: Teaching graphics with Python (was Introductoryhighschool programming) In-Reply-To: <0I1R00CTRB5YNE@mta18.srv.hcvlny.cv.net> Message-ID: <0I1R007AXUJGY3@mta5.srv.hcvlny.cv.net> > -----Original Message----- > From: Kirby Urner [mailto:urnerk@qwest.net] > Sent: Sunday, August 01, 2004 3:23 AM > To: 'Arthur' > Subject: RE: [Edu-sig] Re: Teaching graphics with Python (was > Introductoryhighschool programming) > > > But getting it down to its essentials, the following runs, and provides > a > > sphere primitive that insists on being blue. > > > > Yes, you asked for blue. VPython seems less able than VRML or OpenGL in > general to support textures and like that. Probably because it's > *supposed* > to be a simple API. Yes. I have missed transparency most particularly. But David Scherer explained to me early on that the na?ve view I had that adding transparency in VPython would only involve allowing access to the alpha channel in OpenGL is mistaken. To do it right, based on the way the cvisual code draws, there is all kinds of depth testing necessary to add something like transparency correctly. And he wasn't interested in implementing it in a half-ass manner. But obviously there are no limitations on what you can do in developing an API for exporting VPython objects to Povray. If you access the povexport files at the vpython site, you will see an example of adding wood textures in povray from Vpython. But for your work, you can now simply add your developed povray export code to objects you subclass from cvisual, so that you have the possibility of modeling interactively in VPython, and exporting for more refined rendering in povray in a manner fully under your control, and without re-inventing any wheels. Art From ajsiegel at optonline.net Sun Aug 1 17:14:31 2004 From: ajsiegel at optonline.net (Arthur) Date: Sun Aug 1 17:14:34 2004 Subject: [Edu-sig] Re: Teaching graphics with Python (was Introductoryhighschool programming) In-Reply-To: <0I1Q0082MFL4RQ@mta2.srv.hcvlny.cv.net> Message-ID: <0I1R00HQNX01BY@mta8.srv.hcvlny.cv.net> I had written. > > > > My slides are here: > > http://www.4dsolutions.net/oscon2004/ (might be some minor problems if > > viewed in Windows, not sure (tried to make it work well in both, but > > kept finding little discrepancies going back and forth, and did all > > last minute editing on the Linux side)). > > Looks super. Let me release my ego again, which I think I have successfully kept under control for 3 or 4 posts, running. If you synthesize your 2 major thrusts - Math through programming Graphics through programming perhaps you come to something not far off from what PyGeo attempts. ...whether PyGeo is at all successful in achieving what it attempts being a whole separate matter. I am not fully sure myself, that it does. But I do appreciate your mention of it in your talks. Art From ajsiegel at optonline.net Sun Aug 1 18:19:31 2004 From: ajsiegel at optonline.net (Arthur) Date: Sun Aug 1 18:19:39 2004 Subject: [Edu-sig] Re: Teaching graphics with Python (was Introductoryhighschool programming) In-Reply-To: <0I1R00CTRB5YNE@mta18.srv.hcvlny.cv.net> Message-ID: <0I1S001OJ00DUE@mta8.srv.hcvlny.cv.net> > > import cvisual > > 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.complete_init( self, self, <------- TWO SELVES? > > 1, scene, None) > > > > s=sphere() Yeah. TWO SELVES. I get to this by mechanically following some of what is being done in the primitives.py module of the new VPython distribution. As I say, there is no API documented for the facility of subclassing brought to VPython through the Boost implementation. And I suspect not as much attention was given to developing this as an intuitive API as there might have been, and wouldn't be surprised if there is no intention of the VPython project to document it. Or at least to give documentation of it any priority. I suspect that from the focused concerns of the VPython project, the facility is seen - at least at this point - as a byproduct of the use of Boost, rather than something they want to "confuse" their users with. Doesn't mean I'm not free to confuse their users with it ;). Art From john.zelle at wartburg.edu Sun Aug 1 20:21:00 2004 From: john.zelle at wartburg.edu (John Zelle) Date: Sun Aug 1 20:21:54 2004 Subject: [Edu-sig] Re: Teaching graphics with Python (was Introductoryhigh school programming) In-Reply-To: <20040731175649.6DB6E1E4002@bag.python.org> References: <20040731175649.6DB6E1E4002@bag.python.org> Message-ID: <410D348C.8010709@wartburg.edu> Kirby, This is good stuff. Thanks for the plug! Did Jim talk you into writing a book :-) Thanks also for the OSCON report. --John Kirby Urner wrote: >Hi John -- > >I wanted to thank you for this stereoscopic feature in VPython, and >suggestion that I use it. > >I was sitting in Robin Dunn's tutorial on wxPython this Tuesday at OSCON >when your suggestion drifted into my consciousness. I googled (OSCON had >wifi) and lo and behold, found a 3D stereoscopy club and even a 3D *museum* >right here in Portland ( http://www.cascade3d.org/ ). I emailed a guy and >within 36 hours I had a whole stack of precisely those cheap red/blue >glasses you described. > >I demoed quite a few things during my 45 minute talk, in addition to running >through a bunch of slides in OpenOffice. The 3D thing came towards the end, >and the audience (full room) went "ooooo" as the rhombic triacontahedron >floated in front of them on the large screen, and "ahhhhhhh" as I rotated it >and zoomed in to it. > >I also showed our cellular automata work using your graphics.py, which I >mentioned, as well as holding up your book and talking about how important >this was in the education side of things. > >My slides are here: >http://www.4dsolutions.net/oscon2004/ (might be some minor problems if >viewed in Windows, not sure (tried to make it work well in both, but kept >finding little discrepancies going back and forth, and did all last minute >editing on the Linux side)). > >People came up afterwards, and for the rest of the conference, saying how >much they liked my talk. One guy said he was now persuaded to do Python in >his CS1 next year (most of those present were not educators, but some >advised on the side -- Dana Moore falls in this category (he showcased >Python in Eclipse, so far mostly coded by : >http://conferences.oreillynet.com/cs/os2004/view/e_spkr/524 ) > >The day before, I had a Middle Eastern lunch with your publisher, Jim Leisy >(had never met him before) and Kevin Altis (main author of PythonCard and >co-chair of the Python track at OSCON). > >Other highlights of the conference (from my point of view): > >--- > >Jim Hugunin showed the benchmarks for IronPython on the .NET framework -- >it's working out very well (slower on Mono, but that project has more >optimization to do). Jim starts work for Microsoft on Monday, so it'll be >interesting to see under what terms further IronPython versions get out to >our community > >http://conferences.oreillynet.com/cs/os2004/view/e_sess/5120 > >--- > >GvR's State of Python address introduced us to decorators, which offer a >syntactic replacement for mymethod = staticmethod(mymethod) semantics in a >class. He's going with @ (at sign), which he agrees looks unPythonic, but >on the other hand there are good reasons for not inventing new key words. >He knows this is controversial and is prepared to rip it out or change it if >the community goes bananas. Decorators should be in the next alpha release >of 2.4. > >He also talked about the new generator comprehensions and some of the >subtleties involving late binding which could confuse people (more on that >in a next post). > >http://conferences.oreillynet.com/cs/os2004/view/e_sess/4981 > >--- > >Alex Martelli gave a sophisticated presentation on Design Patterns, and as >this preceded my talk, I was able to use 'fa?ade' as a part of my patter (I >build a fa?ade, an adapter which limits the back end interface, into >POV-Ray, VPython and the like). > >The other highlight re Alex was he and Anna just got married and shared >slides and music from this event during the Lightning Talks. > >--- > >Michel Pelletier's talk overlapped a lot with Alex's. It was less about >Zope3 and more about the importance of interfaces and adapters in Zope, PEAK >and Twisted. He made a strong argument for bring interfaces into the syntax >of Python in some way, so that Python would be able to compete effectively >on these new multi-language VMs (.NET, Mono and Parrot). > >http://conferences.oreillynet.com/cs/os2004/view/e_sess/5298 > >--- > >I already mentioned the Python-in-Eclipse work, which is still beta, but >coming along nicely. > >Andy McKay and Joel Burton did a very effective job presenting about Plone >this time. Joel covered all the basics in a half day tutorial, and Andy >focused on Archetypes, a technology for defining new data types within Plone >without having to code too much. Andy, who has a new book out on Plone >(Apress: http://www.apress.com/book/bookDisplay.html?bID=335 ), is the chief >organizer behind VanPy (Python conference in Vancouver, BC) which starts >like today or tomorrow. I'm not able to attend. > >Kirby > > >_______________________________________________ >Edu-sig mailing list >Edu-sig@python.org >http://mail.python.org/mailman/listinfo/edu-sig > > > > From urnerk at qwest.net Sun Aug 1 20:51:38 2004 From: urnerk at qwest.net (Kirby Urner) Date: Sun Aug 1 20:51:40 2004 Subject: [Edu-sig] Re: Teaching graphics with Python (was Introductoryhighschool programming) In-Reply-To: <0I1S001OJ00DUE@mta8.srv.hcvlny.cv.net> Message-ID: <20040801185139.6737C1E4002@bag.python.org> Arthur: > As I say, there is no API documented for the facility of subclassing > brought to VPython through the Boost implementation. > > And I suspect not as much attention was given to developing this as an > intuitive API as there might have been, and wouldn't be surprised if there > is no intention of the VPython project to document it. Or at least to > give documentation of it any priority. These go together. By not documenting any API, they're free to give more thought to changing it later. Once documented, it's harder to keep revamping it. Until there's some documentation, I guess it's very unsafe (in the sense of future code breakage) to build any real codebase on the new subclassing features. Kirby From ajsiegel at optonline.net Mon Aug 2 00:43:02 2004 From: ajsiegel at optonline.net (Arthur) Date: Mon Aug 2 00:43:57 2004 Subject: [Edu-sig] Re: Teaching graphics with Python (was Introductoryhighschool programming) In-Reply-To: <0I1S00ITL71ZE2@mta21.srv.hcvlny.cv.net> Message-ID: <0I1S00APOHRJP7@mta8.srv.hcvlny.cv.net> > > Arthur: > > As I say, there is no API documented for the facility of subclassing > > brought to VPython through the Boost implementation. > > > > And I suspect not as much attention was given to developing this as an > > intuitive API as there might have been, and wouldn't be surprised if > there > > is no intention of the VPython project to document it. Or at least to > > give documentation of it any priority. > > These go together. By not documenting any API, they're free to give more > thought to changing it later. Once documented, it's harder to keep > revamping it. I hope that is the direction they are going. Just don't know. Bruce has disappointed me before. He tends to like to control the flow of information in ways that I am not totally comfortable with. There are smart guys who know there are plenty of other smart (and smarter) guys out there. And then there are the guys who *always* seem to worry about talking over peoples heads. One of the things I love about the Open Source community is the struggle to keep up. > > Until there's some documentation, I guess it's very unsafe (in the sense > of > future code breakage) to build any real codebase on the new subclassing > features. I wouldn't worry about it too much. I don't see much changing other than possibly the initialization routine. With modern text editors... Art From urnerk at qwest.net Mon Aug 2 05:07:57 2004 From: urnerk at qwest.net (Kirby Urner) Date: Mon Aug 2 05:08:00 2004 Subject: [Edu-sig] Re: Teaching graphics with Python In-Reply-To: <0I1Q00J81FJ5NT@mta3.srv.hcvlny.cv.net> Message-ID: <20040802030759.AF94C1E4002@bag.python.org> > 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 From ajsiegel at optonline.net Mon Aug 2 10:38:08 2004 From: ajsiegel at optonline.net (Arthur) Date: Mon Aug 2 10:38:10 2004 Subject: [Edu-sig] Re: Teaching graphics with Python In-Reply-To: <20040802030759.AF94C1E4002@bag.python.org> Message-ID: <0I1T00M729BAL0@mta10.srv.hcvlny.cv.net> > > 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 From ajsiegel at optonline.net Mon Aug 2 14:45:21 2004 From: ajsiegel at optonline.net (Arthur) Date: Mon Aug 2 14:45:28 2004 Subject: [Edu-sig] Re: Teaching graphics with Python In-Reply-To: <20040802030759.AF94C1E4002@bag.python.org> Message-ID: <0I1T00B8GKRPQW@mta7.srv.hcvlny.cv.net> > -----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 From gen2n at seznam.cz Sat Aug 7 21:10:30 2004 From: gen2n at seznam.cz (gen2n) Date: Sat Aug 7 21:11:06 2004 Subject: [Edu-sig] collection of exercises Message-ID: <004d01c47cb2$38d7b4a0$63369453@extensa> There are a lot of tutorials and references on the Net, but I somehow much miss some examples/exercises that are in my view necessary for full and deep understanding of explained matter. I have in mind exercises for non-university-people where are practised either single structures of a language or generally understood exercises that could be then solved in any language. Do you know any? Pavel Kosina -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/edu-sig/attachments/20040807/20fce112/attachment.html From urnerk at qwest.net Sun Aug 8 06:36:31 2004 From: urnerk at qwest.net (Kirby Urner) Date: Sun Aug 8 06:36:35 2004 Subject: [Edu-sig] collection of exercises In-Reply-To: <004d01c47cb2$38d7b4a0$63369453@extensa> Message-ID: <20040808043633.471621E4003@bag.python.org> An example of what you're looking for might help. I've seen exercises to be solved in any language (left to the students to choose which), in the context of a competition for programming teams (high schoolers). But I don't know if this would be at all in the ballpark. Kirby _____ From: edu-sig-bounces@python.org [mailto:edu-sig-bounces@python.org] On Behalf Of gen2n Sent: Saturday, August 07, 2004 12:11 PM To: edu-sig@python.org Subject: [Edu-sig] collection of exercises There are a lot of tutorials and references on the Net, but I somehow much miss some examples/exercises that are in my view necessary for full and deep understanding of explained matter. I have in mind exercises for non-university-people where are practised either single structures of a language or generally understood exercises that could be then solved in any language. Do you know any? Pavel Kosina -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/edu-sig/attachments/20040807/9d68a328/attachment.html From urnerk at qwest.net Sun Aug 8 07:07:02 2004 From: urnerk at qwest.net (Kirby Urner) Date: Sun Aug 8 07:07:04 2004 Subject: [Edu-sig] story re a python class (in a police station) Message-ID: <20040808050702.DEAA51E4003@bag.python.org> Here's an article about an open source class I co-taught in June, which included some Python programming: http://www.oregonlive.com/search/index.ssf?/base/news/1090963968123690.xml?a rgus?News -- may prompt for zip, dob, gender. Kirby From kent37 at tds.net Fri Aug 20 03:43:48 2004 From: kent37 at tds.net (Kent Johnson) Date: Fri Aug 20 03:43:52 2004 Subject: [Edu-sig] How to introduce test-driven development? Message-ID: <200408200143.i7K1hmif005169@outbound1.mail.tds.net> Hello, I am going to be teaching introductory Python programming in an adult education program this fall. (Finally! I wanted to do this in the spring but it didn't work out.) I want to introduce the students to unittest and test-first programming but I am not sure when and how to do this. - using unittest requires a bit of understanding of classes unless I want to wave my hands quite a bit - beginning programs may not have much to test, especially if they are heavily oriented toward console I/O I'm tempted to just wing it - wait for a student to bring a problem that lends itself to testing, then demonstrate unittest and TDD. But I am interested in other ideas :-) Thanks, Kent From kent37 at tds.net Fri Aug 20 12:42:50 2004 From: kent37 at tds.net (Kent Johnson) Date: Fri Aug 20 12:42:54 2004 Subject: [Edu-sig] How to introduce test-driven development? Message-ID: <200408201042.i7KAgo3g004241@outbound3.mail.tds.net> Peter, Thanks for the suggestion! I'll have to play around with doctest myself, I have never used it. BTW the course is open to the public. Anyone in the vicinity of Merrimack, NH, US who wants to learn Python, go to http://www.merrimack.k12.nh.us/ to register! Kent > > From: Peter Fr?hlich > Date: 2004/08/19 Thu PM 11:45:46 EDT > To: Kent Johnson > CC: > Subject: Re: [Edu-sig] How to introduce test-driven development? > > Hi all! > > On Aug 19, 2004, at 18:43, Kent Johnson wrote: > > > I am going to be teaching introductory Python programming in an adult > > education program this fall. (Finally! I wanted to do this in the > > spring but it didn't work out.) I want to introduce the students to > > unittest and test-first programming but I am not sure when and how to > > do this. > > I'd suggest introducing doctest instead of pyunit. It's simpler, no > classes, just like the interpreter, etc. Worked well for me when I > introduced it to my students. > > BTW, please be sure to let the list know how your course is going. I am > planning to introduce some Python in an (essentially) social science > class next year. :-) > > Peter > -- > Peter H. Froehlich <><><><><><> http://www.cs.ucr.edu/~phf/ > OpenPGP: D465 CBDD D9D2 0D77 C5AF 353E C86C 2AD9 A6E2 309E > >