From ajsiegel at optonline.net Sat Jan 1 14:49:36 2005 From: ajsiegel at optonline.net (Arthur) Date: Sat Jan 1 14:49:50 2005 Subject: [Edu-sig] More calculus in Python Message-ID: <0I9N00LFB52Z5B@mta10.srv.hcvlny.cv.net> >>Not either/or, but no concrete plans over here right now. >>Kirby Turns out there is no more to plotting the function and its derivative using Vpython than adding this your calc.py module: if __name__ == "__main__": newp = p1 * p1 * p1 from visual.graph import * uplot = gcurve(color=color.cyan) # a connected curve object for x in arange(-5, 6.1, 0.1): # x goes from -5 to 6 uplot.plot(pos=(x,newp.u(x))) # plot uplot = gcurve(color=color.red) # a connected curve object for x in arange(-5., 6.1, 0.1): # x goes from -5 to 6 uplot.plot(pos=(x,newp.du(x))) # plot By varying the definition of newp one gets some quick visual feedback of the "shape" of functions and their derivatives. All to better effect, IMO, than the static illustrations one sees in a text - assuming that following the logic of the calc.py code is a required part of the learning process. Not that following the logic of the code is particularly easy - but at least one's efforts can be concentrated on just that - following the *logic* - the code as code, in Python, being pretty transparent. Art From john.zelle at wartburg.edu Sat Jan 1 18:57:44 2005 From: john.zelle at wartburg.edu (John Zelle) Date: Sat Jan 1 19:01:27 2005 Subject: [Edu-sig] New graphics library (beta version) In-Reply-To: <20041230045953.98BED1E4003@bag.python.org> References: <20041230045953.98BED1E4003@bag.python.org> Message-ID: <41D6E498.7060607@wartburg.edu> Thanks to those of you who tried this out. I managed to get another day to work on it, and I'm satisfied that what I have now is a major improvement from the previous (non-threaded) version. I've tested it fairly thoroughly under Linux (I do have a test suite, but a lot of the checks have to be visual) and have had good reports from others under Windows. I've decided to go ahead and release it. We'll definitely be using it here this winter term. The newest version improves on the beta version I sent out earlier by adding some important error checking. This version should not leave any hanging threads. Anyone who wants to update to the newest version can find it on my Python page: http://mcsp.wartburg.edu/zelle/python I've also updated the documentation there to match the newest version. --John Kirby Urner wrote: >>Please give this a try if you're interested. Any and all feedback is >>welcome. >> >>--John >> >> > >I forget if there's a test suite of programs, or something else you run to >decide whether it's ready for prime time. I've got some graphics.py >dependents around, e.g. that cellular automata stuff we did awhile back, >plus other stuff I worked on with Bernie. > >I've stashed your code in my Python24 site-packages on WinXP. Compaq >(Linux) has showed signs of trouble ever since the Ubuntu fiasco. Then >there's TMU running Mandrake 10.1 -- haven't fired up Samba on that one yet >to make it part of my network neighborhood. > >Kirby > > >_______________________________________________ >Edu-sig mailing list >Edu-sig@python.org >http://mail.python.org/mailman/listinfo/edu-sig > > > > From lac at strakt.com Sun Jan 2 17:15:03 2005 From: lac at strakt.com (Laura Creighton) Date: Sun Jan 2 17:15:09 2005 Subject: [pypy-dev] Re: [Edu-sig] Learn to Program in Ten Years In-Reply-To: Message from Dethe Elza of "Wed, 29 Dec 2004 21:55:05 PST." <5ACEE26B-5A27-11D9-B064-0003939B59E8@livingcode.org> References: <20041226000207.CA8BA1E4005@bag.python.org> <5ACEE26B-5A27-11D9-B064-0003939B59E8@livingcode.org> Message-ID: <200501021615.j02GF3f2019475@ratthing-b246.strakt.com> Happy New Year, Dethe! Thank you for your interest. You write: >PyPy uses a similar approach to Pyrex, called Psyco, which compiles >directly to 80x86 machine code (Pyrex compiles to cross-platform C >code). This allows PyPy to attempt to be faster than C-Python by >creating compiler optimizations. Not sure what the PyPy story is for >non-x86 platforms. There is also a project to recreate Python on top >of Smalltalk, by L. Peter Deutch, which he expects to be faster than >C-Python (and if anyone can do it, he could). >Nice to see y'all again. Happy New Year (or Gnu Year?). >--Dethe I'd like to clarify a few misunderstandings I think you have. Psyco is not a technique, but rather a specialising compiler available as a Python extension module. It compiles directly to 386 machine code. PyPy, on the other hand, currently emits cross-platform C code. Our previous version emitted Pyrex code. Some people in Korea are making a version that emits Lisp code. PyPy doesn't use Psyco, though many ideas are common to both. What's more there is nothing magic about machine code that makes it automatically fast -- an inefficiently-coded algorithm in assembler is still a turtle. The win in using PyPy is not about 'saving the time it takes to have a conversation with your C compiler', but instead about making such conversations more productive and useful. The more information you can tell your C compiler about your data, the better code it is prepared to generate. This is the tradeoff between flexibility and speed. When your Python system sees x = a + b it has no clue as to what types a and b are. They could be anything. This 'being ready to handle everything' has a large performance penalty. The runtime system has to do be prepared to do a _lot_, so it has to be fairly intelligent. All this intelligence is in the form of code instructions, and there are a lot of them that the runtime system has to execute, every time it wants to do anything at all. On the other hand, at code _reading_ time, the Python interpreter is purposely stupid-but-straightforward. It doesn't have much to do, and so can be relatively quick about not doing it. A statically-typed compiled language works in precisely the other way. When the runtime system of a statically typed language sees x = a+ b, it already knows all about x, a and b and their types. All the hard work was done in the compiling phase. There is very little left to worry about -- you might get an overflow exception or something -- but as an oversimplification, all the runtime system of a statically typed langauge has to know how to do is how to load and run. That's fast. So, one way you could speed up Python is to add type declarations, thus simplifying the life of the runtime system. This proposed solution is more than a little drastic for those of us who like duck typing, signature based polymorphism, and the particular way coding in Python makes you think and feel. The PyPy alternative is to make the interpreter even smarter, and a whole lot better at remembering what it does. For instance, when it sees x = a + b instead of just adding this particular int to this other particular int, it could generate some general purpose code for adding ints to ints. This code could be thus used for all ints that you wish to add this way. So while the first time is slow, the _next_ time will be a lot faster. And that is where the performance speedup happens -- in code where the same lines get run again, and again, and again. If all you have is a mainline where each line of code gets executed once, then we won't help you at all. Psyco is about as far as you can get with this approach and be left with a module you can import and use with regular python 2.2 or better. See: http://psyco.sourceforge.net/ PyPy is what you get when you pitch the old interpreter and write your own. See: http://codespeak.net/pypy/ And we should probably move further disussion to pypy-dev, here: http://codespeak.net/mailman/listinfo/pypy-dev Thanks for your interest, and thanks for writing, Laura Creighton (for PyPy) From urnerk at python.org Sun Jan 2 19:26:35 2005 From: urnerk at python.org (Kirby Urner) Date: Sun Jan 2 19:26:35 2005 Subject: [pypy-dev] Re: [Edu-sig] Learn to Program in Ten Years In-Reply-To: <200501021615.j02GF3f2019475@ratthing-b246.strakt.com> Message-ID: <20050102182635.5E0311E4004@bag.python.org> > Thanks for your interest, > and thanks for writing, > > Laura Creighton (for PyPy) And thank *you* Laura, for providing some succinct and intelligent overview. Much appreciated over here. Kirby From delza at livingcode.org Sun Jan 2 20:49:35 2005 From: delza at livingcode.org (Dethe Elza) Date: Sun Jan 2 20:49:44 2005 Subject: [pypy-dev] Re: [Edu-sig] Learn to Program in Ten Years In-Reply-To: <200501021615.j02GF3f2019475@ratthing-b246.strakt.com> References: <20041226000207.CA8BA1E4005@bag.python.org> <5ACEE26B-5A27-11D9-B064-0003939B59E8@livingcode.org> <200501021615.j02GF3f2019475@ratthing-b246.strakt.com> Message-ID: <6E1C07E6-5CF7-11D9-BD26-0003939B59E8@livingcode.org> Laura wrote: > I'd like to clarify a few misunderstandings I think you have. Psyco is > not a technique, but rather a specialising compiler available as a > Python extension module. It compiles directly to 386 machine > code. PyPy, on the other hand, currently emits cross-platform C > code. Our previous version emitted Pyrex code. Some people in Korea > are making a version that emits Lisp code. PyPy doesn't use Psyco, > though many ideas are common to both. [Much more good explanation snipped] Thanks for the clarifications. In the beginning of the PyPy project I think there was some mention of using Psyco, or similar, tools to achieve performance equal to or exceeding that of C-Python. I hadn't realized that Psyco had been dropped. The PyPy project has intrigued me for some time, but the web site doesn't generally give a good idea of the state of the project, or good starting points for learning more, but I do keep checking back from time to time. --Dethe "According to the ?New York Times?, last year White House lawyers concluded that President Bush could legally order interrogators to torture and even kill people in the interest of national security - so if that?s legal, what the hell are we charging Saddam Hussein with?" --Jay Leno -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2488 bytes Desc: not available Url : http://mail.python.org/pipermail/edu-sig/attachments/20050102/559a1c8a/smime.bin From lac at strakt.com Sun Jan 2 21:02:27 2005 From: lac at strakt.com (Laura Creighton) Date: Sun Jan 2 21:02:31 2005 Subject: [pypy-dev] Re: [Edu-sig] Learn to Program in Ten Years In-Reply-To: Message from Dethe Elza of "Sun, 02 Jan 2005 11:49:35 PST." <6E1C07E6-5CF7-11D9-BD26-0003939B59E8@livingcode.org> References: <20041226000207.CA8BA1E4005@bag.python.org> <5ACEE26B-5A27-11D9-B064-0003939B59E8@livingcode.org> <200501021615.j02GF3f2019475@ratthing-b246.strakt.com> <6E1C07E6-5CF7-11D9-BD26-0003939B59E8@livingcode.org> Message-ID: <200501022002.j02K2RAs020079@ratthing-b246.strakt.com> In a message of Sun, 02 Jan 2005 11:49:35 PST, Dethe Elza writes: > >Thanks for the clarifications. In the beginning of the PyPy project I >think there was some mention of using Psyco, or similar, tools to=20 >achieve performance equal to or exceeding that of C-Python. I hadn't=20 >realized that Psyco had been dropped. The PyPy project has intrigued=20 >me for some time, but the web site doesn't generally give a good idea=20 >of the state of the project, or good starting points for learning more,=2 >0= > >but I do keep checking back from time to time. > >--Dethe We need to work on the website. I'll post something here when we're done revamping it, and see if things are a little clearer. Thanks for letting us know that its as bad as we feared. Laura From ajsiegel at optonline.net Mon Jan 3 15:18:30 2005 From: ajsiegel at optonline.net (Arthur) Date: Mon Jan 3 15:21:45 2005 Subject: [pypy-dev] Re: [Edu-sig] Learn to Program in Ten Years In-Reply-To: <200501021615.j02GF3f2019475@ratthing-b246.strakt.com> References: <20041226000207.CA8BA1E4005@bag.python.org> <5ACEE26B-5A27-11D9-B064-0003939B59E8@livingcode.org> <200501021615.j02GF3f2019475@ratthing-b246.strakt.com> Message-ID: <1104761910.3048.4.camel@localhost.localdomain> On Sun, 2005-01-02 at 17:15 +0100, Laura Creighton wrote: > Psyco is about as far as you can get with this approach and be left > with a module you can import and use with regular python 2.2 or > better. See: http://psyco.sourceforge.net/ FWIW, it turns out that using Psyco seems to break my threading solution that allows me to run a Tk window and a VPython GTK window each in a mainloop() and each responsive to user interaction. May say more about the fragility of my solution than the limitations of Psyco. Art From urnerk at qwest.net Mon Jan 3 18:17:27 2005 From: urnerk at qwest.net (Kirby Urner) Date: Mon Jan 3 18:17:28 2005 Subject: [Edu-sig] update: satacad python pdx In-Reply-To: <1104761910.3048.4.camel@localhost.localdomain> Message-ID: <20050103171727.3BE521E4002@bag.python.org> Well, it's the start of our business calendar in 2005, and time to see what's up with the accounts (accounts@4dsolutions.net). I big part of my month is allocated to this computer course, around which I built my grant proposal to the PSF. Now let's see if it's going to actually happen. I think from my side (the teacher), I've completed all the necessary paper work. Kirby ================= Hi Gini -- Still trying to figure out if there's a class next Saturday, that I'm teaching, but for which I have no student list nor conception of the room I'm to use at OGI or wherever. Is anyone signed up for: Math & Programming: From Chaos to Python? Kirby http://www.saturdayacademy.pdx.edu/classes/ClassesWinter2005/class_mathandpr ogramming.htm Status: Available Course #: 6299 Location: OGI Dates: Six Saturdays, January 8 - February 12 Time: 10:00 AM - 12:30 PM Grades: 9 - 12 Tuition: $145 Prerequisites: Completion of Algebra or currently enrolled in Algebra. ------------------ Rest of course description, tacked on for edu-sig archive: Explore topics in mathematics by writing and modifying programs in a contemporary computer language. A goal of this class is to help you gain proficiency as a programmer, while delving into number theory, group theory, chaos and fractals, cryptography, 3D graphics and more. A primary tool will be Python, an object oriented, uncluttered, general purpose language. For contrast and mind expansion, the J language will also be introduced. Instructor: Kirby Urner, with a BA in philosophy from Princeton University , is a computer programmer and educator. He has developed computer literacy products for McGraw-Hill and is a former high school mathematics teacher. Status: Available Course #: 6299 Location: OGI Dates: Six Saturdays, January 8 - February 12 Time: 10:00 AM - 12:30 PM Grades: 9 - 12 Tuition: $145 Prerequisites: Completion of Algebra or currently enrolled in Algebra. From urnerk at qwest.net Mon Jan 3 18:58:46 2005 From: urnerk at qwest.net (Kirby Urner) Date: Mon Jan 3 18:58:48 2005 Subject: [Edu-sig] update: satacad python pdx In-Reply-To: <20050103171727.3BE521E4002@bag.python.org> Message-ID: <20050103175847.6CC231E4002@bag.python.org> Followup: OK, Gini is on it. I think it's dawning down at the PSU home office that I'm a new guy. Sure, I did the police station (West Precinct, Hillsboro), but that's a totally different setup (RedHat9 lab, whereas OGI is WinXP, and with its own rules I'm sure). I'm told I have 7 kids signed up, 9th and 10th graders. That'll be good. The three packages I know I need: Python (2.3 or 2.4), J, POVray. Packages I might need: wxWindows, PythonCard, VPython, PyGeo. Mostly I'm hoping to enroll these students in the idea of using Python more on their own. Since I'll have a projector, I'll showcase stuff like wxWindows (demo) and PyGeo, to give them ideas (Pygame as well). I'll encourage them to get that my course is about opening a lot of doors, but during the class itself, we will only go through some of them, and many of those will be into realms of mathematics, i.e. no new software downloads needed, in many cases. Kirby > -----Original Message----- > From: edu-sig-bounces@python.org [mailto:edu-sig-bounces@python.org] On > Behalf Of Kirby Urner > Sent: Monday, January 03, 2005 9:17 AM > To: edu-sig@python.org > Subject: [Edu-sig] update: satacad python pdx > > > Well, it's the start of our business calendar in 2005, and time to see > what's up with the accounts (accounts@4dsolutions.net). I big part of my > month is allocated to this computer course, around which I built my grant > proposal to the PSF. Now let's see if it's going to actually happen. I > think from my side (the teacher), I've completed all the necessary paper > work. > > Kirby From urnerk at qwest.net Tue Jan 4 05:56:59 2005 From: urnerk at qwest.net (Kirby Urner) Date: Tue Jan 4 05:57:03 2005 Subject: [Edu-sig] satacad python pdx Message-ID: <20050104045702.DF81A1E4002@bag.python.org> Hi folks -- this is some more legwork around the Python class I'm about to start, in the capacity of instructor (I of course do Python classes as a student as well -- like at Pycon or OSCON or like that). I'm being somewhat thorough in showing what this looks like from the inside, in hopes of inspiring others to consider similar strategies, e.g. teaching Python with some other language, while focusing on some knowledge domain (math in this case). I'm not saying all these strategies should be adopted across the board, just that you might get some good ideas following my progress. For starters, find out if your community offers a similar infrastructure for offering academic enrichment outside of normal schooling. It'll likely be university-based or university-connected. Consistent with the goals of CP4E, we need to get Python in the hands of many more students than just the CS majors. Posting to the J Forum appended. Kirby -----Original Message----- From: Kirby Urner [mailto:kirby@4DSOLUTIONS.NET] Sent: Monday, January 03, 2005 8:25 PM To: JFORUM@PEACH.EASE.LSOFT.COM Subject: [Jforum] Urner rejoins, intro Greetings J-ists -- I was subscribed some time ago, as maybe the archives will disclose, and now I'm back, in part because I'm scheduled to teach a computer course starting this Saturday, and I intend to focus on both J and Python. Here're some details: --- Explore topics in mathematics by writing and modifying programs in a contemporary computer language. A goal of this class is to help you gain proficiency as a programmer, while delving into number theory, group theory, chaos and fractals, cryptography, 3D graphics and more. A primary tool will be Python, an object oriented, uncluttered, general purpose language. For contrast and mind expansion, the J language will also be introduced. Instructor: Kirby Urner, with a BA in philosophy from Princeton University , is a computer programmer and educator. He has developed computer literacy products for McGraw-Hill and is a former high school mathematics teacher. --- I'm not a black belt J programmer, but do have some appreciation for it, APL being my first love as a language (Princeton had APL workstations scattered around campus in the 1970s, wired to the IBM 370 mainframe). Here's a web page I published as a result of my explorations in J awhile back: http://www.4dsolutions.net/ocn/Jlang.html I'm somewhat rusty at this point, and I think reading posts on the J list will be a good way to help me limber up a bit. I'll also paw through the archives a bit to find out what's been going on. Kirby NOTE: I'm cross-posting this to edu-sig (@ python.org), where I'll be doing some archiving about this course as well. As a rule of thumb, I will *not* cross-post between these two lists (I know how annoying that can be). -------------------------------------------------------------------------- For information about the J Forum see http://www.jsoftware.com/j_forum.htm From dblank at brynmawr.edu Tue Jan 4 15:44:44 2005 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Tue Jan 4 15:44:51 2005 Subject: [Edu-sig] Genealogy in Python Message-ID: <41DAABDC.5060103@brynmawr.edu> Edu-sig, There is a genealogy project that has been going on for awhile that you may be familiar with called Gramps. They have done some very fine work over the years building a nice application in gtk/gnome/python. I have a proposal with them that I am mentioning over here for a couple of reasons. First, I'm thinking that having real family tree data handy for each student would be a great resource for CS homework. For example, all of the standard tree-based algorithms could be explored in the family tree domain. Are two people related? Is person1 an ancestor of person2? etc. Other problems become concrete: which of your relatives were alive in 1900? How old were they? (That last one is trickier than you might guess, especially with incomplete data). (Not every person will have access to their family's data, but alternate trees can be used in that case. Large trees could also be used for seeing Big-Oh in action.) Secondly, part of the proposal is to make Gramps a bit more accessible by reducing the software requirements (by making ncurses or Tkinter interfaces), and by making the code have easy-to-pickup Pythonic methods. The questions: would you, or someone you know be interested in working on the project? If you teach, would this be a resource that you could use? If you are interested in genealogy, would you be interested in (or are you) using Gramps? Thanks! -Doug -- Douglas S. Blank, Assistant Professor dblank@brynmawr.edu, (610)526-6501 Bryn Mawr College, Computer Science Program 101 North Merion Ave, Park Science Bld. Bryn Mawr, PA 19010 dangermouse.brynmawr.edu From urnerk at qwest.net Thu Jan 6 04:39:19 2005 From: urnerk at qwest.net (Kirby Urner) Date: Thu Jan 6 04:39:21 2005 Subject: [Edu-sig] satacad python pdx In-Reply-To: <20050104045702.DF81A1E4002@bag.python.org> Message-ID: <20050106033920.0D6A61E4004@bag.python.org> Got to check out my classroom today. Looks pretty state of the art. Ceiling mounted InFocus connected to the instructor station, several rows student stations, now each loaded with Python, Povray and J. Internet connectivity. Good lighting, heating/cooling, other amenities. Now the remaining uncertainty is snow, forecast as likely for this Saturday. I'm hoping it's not serious, as the first day of class is always plenty chaotic without the added twist of inclement weather. I'm also scheduled to teach core Python to some GIS company here in PDX on March 28 (two 1.5 hour sessions). That's very close to Pycon. I'd have to high tail it back. I think Portland is fortunate in having quite a few snake charmers of high caliber, such as Kevin Altis, Kevin Turner, Dylan Reinhardt and others. If demand for Python trainers grows, we should be able to cover the field by intelligently coordinating our efforts (e.g. Altis is our GUI guru, and Dunn, but he's all the way in Vancouver :-D). Plus at OSCON I learned we even have Michel Pelletier, co-author of The Zope Book. I've never seen him at a PORPIG meeting though. I'd like to learn more about his concept of interfaces in Python. Kirby From ajsiegel at optonline.net Thu Jan 6 15:09:00 2005 From: ajsiegel at optonline.net (Arthur) Date: Thu Jan 6 15:09:50 2005 Subject: [Edu-sig] satacad python pdx In-Reply-To: <20050106033920.0D6A61E4004@bag.python.org> Message-ID: <0I9W001OLFBBGI@mta1.srv.hcvlny.cv.net> Kirby writes - > > I think Portland is fortunate in having quite a few snake charmers of high > caliber, such as Kevin Altis, Kevin Turner, Dylan Reinhardt and others. > If > demand for Python trainers grows, we should be able to cover the field by > intelligently coordinating our efforts (e.g. Altis is our GUI guru, and > Dunn, but he's all the way in Vancouver :-D). Isn't Patrick Logan another PortlandPythonista? Surprisingly I am not aware of much activity in New York. What there is seems very Zope-centric. BTW I was thrilled that you mentioned you might give PyGeo an appearance at your class. I would love it if you used a more recent version than is on my website. I am particularly interested in what you think of the approach I am taking to documentation. The effort there is to again combine exposure of the API to some exposure to the geometric concepts. For exposure to the geometric concepts I take advantage of Web resources, most particularly MathWorld http://mathworld.wolfram.com/ So, for example, when I document the PyGeo class CircumCircle, I link to http://mathworld.wolfram.com/Circumcircle.html etc. (docutils was a godsend in writing the docs. The docutils source text of the PyGEo docs are in the doc tree, so you might even use it to show off docutils a bit - i.e. how the source text is formatted and transformed to the html by docutils) Given your classroom has internet connectivity, you can take advantage of this, or at this demonstrate it. The currentish version is available from my sourceforge site: http://sourceforge.net/projects/pygeo/ If you find retrieving it from cvs a pain, let me know and I'll send you a copy. Art From Scott.Daniels at Acm.Org Thu Jan 6 20:36:21 2005 From: Scott.Daniels at Acm.Org (Scott David Daniels) Date: Thu Jan 6 20:34:59 2005 Subject: [Edu-sig] Re: satacad python pdx In-Reply-To: <20050106033920.0D6A61E4004@bag.python.org> References: <20050104045702.DF81A1E4002@bag.python.org> <20050106033920.0D6A61E4004@bag.python.org> Message-ID: Kirby Urner wrote: > Got to check out my classroom today. Looks pretty state of the art. > Ceiling mounted InFocus connected to the instructor station, several rows > student stations, now each loaded with Python, Povray and J. Internet > connectivity. Good lighting, heating/cooling, other amenities. You might want to include VPython -- there is a working beta for 2.4. -- -- Scott David Daniels Scott.Daniels@Acm.Org From ajsiegel at optonline.net Thu Jan 6 21:18:48 2005 From: ajsiegel at optonline.net (Arthur) Date: Thu Jan 6 21:19:29 2005 Subject: [Edu-sig] Re: satacad python pdx In-Reply-To: Message-ID: <0I9W00BBKWFGBO@mta1.srv.hcvlny.cv.net> > Kirby Urner wrote: > > Got to check out my classroom today. Looks pretty state of the art. > > Ceiling mounted InFocus connected to the instructor station, several > rows > > student stations, now each loaded with Python, Povray and J. Internet > > connectivity. Good lighting, heating/cooling, other amenities. > > You might want to include VPython -- there is a working beta for 2.4. And this is the first pre-built distro for Windows of the Boost version of VPython. The cvs version of PyGeo only works against this version of VPython, as it makes use of the ability to inherit from VPython C++ classes in Python. Not for any particularly good reason, BTW ;) It was there. Unfortunately we tend to do that kind of thing sometimes. One of the arguments I see people raising against optional static typing is that once it is there it will be used for no particularly good reason as well as for the particularly good ones. I think I liked Kirby's version of calc.py that *didn't* use decorators more than I did the one that did, though I understand why he couldn't resist the temptation to use it. Using a feature appropriately, and using it wisely are sometimes too different things. If its in the language (or API) it is usually assumed that using appropriately is also using it wisely. Which puts more pressure on the language, or API designer. I think it generally understood that Guido is hoping that decorators are used, not overused. With all that, Kirby's calc.py decorator version did have the advantage of providing a simple tutorial example of the use of decorators for those of us (or maybe its just me) still trying to get our arms around the basic mechanics of decorators. But I find I still like reading down a page, not zigzag. Have I digressed, again? Art From urnerk at qwest.net Fri Jan 7 18:23:58 2005 From: urnerk at qwest.net (Kirby Urner) Date: Fri Jan 7 18:23:59 2005 Subject: [Edu-sig] Re: satacad python pdx In-Reply-To: Message-ID: <20050107172358.7BDBE1E4003@bag.python.org> > You might want to include VPython -- there is a working beta for 2.4. > For sure. VPython rocks. I even have a stack of red/blue stereo glasses here somewhere, which I intend to use (John Zelle pointed me to this feature, and I used it at OSCON 2004 to good effect). I had Python 2.3 installed in my classroom, so I'll be using older versions of Vpython and PyGeo. However, I'm scheduled to do this class again in the spring and will expect to use Python 2.4 and its add-ons. Here's a recent post giving some more overview on how I thinking about math education these days: http://www.mathforum.com/epigone/mathedcc/phungzilvu Regarding the Yahoo egroup I intend to set up around this class, I'm thinking I could open membership to interested edu-sig subscribers, as well as to my students. I'll post more details soon. Kirby From urnerk at qwest.net Sun Jan 9 19:21:46 2005 From: urnerk at qwest.net (Kirby Urner) Date: Sun Jan 9 19:21:46 2005 Subject: [Edu-sig] python satacad: class 1 (overview) In-Reply-To: <20050107172358.7BDBE1E4003@bag.python.org> Message-ID: <20050109182145.D77D11E400B@bag.python.org> OK, the first class went pretty well I thought. I have seven students, 9th and 10th graders (at least one is home schooled). None of them know each other, to start, nor have I ever met any of them. We're all strangers. When they walk in, sometimes with a parent (parents don't get to stay though), they see a projected picture of a personal computer of 2004 -- as envisioned by some guy at the RAND corporation in 1954. Here's the picture (from Popular Mechanics): http://www.4dsolutions.net/satacad/background/pc2004.jpg (I once told mom in an email that this might be Rumsfeld's problem -- he's still living in a past version of the future). If using FireFox, click the magnifying glass to get full size (easier to read the caption). The projector was always on during the class. At one point I did a lot of fumbling to get my Linux laptop hooked up, as the instructor's Win2000 box doesn't have a DVD player and I wanted to show some opening takes from 'Revolution OS'. I emphasized to this class that Greater Portland (our land) is a kind of Mecca in the open source community (hey, Linus himself lives here), whereas Greater Seattle is more of a Vatican for the closed source community (Bill Gates and his minions). This was a subtle allusion to 'The Cathedral and the Bazaar' of course, which I don't expect anyone got (Eric Raymond was in two video clips I showed, but I doubt many made the connection there, either). We watched 'Warriors of the Net' in its entirety. A lot of these students indicated on the reg forms that they were wanting to learn more about computers. In the old days, that'd mean starting with the CPU, bus, peripherals, talking about registers, RAM, BIOS. All that is still important, but it makes just as much sense to start with TCP/IP (which is what 'Warriors' is about). During the Python segments, we used IDLE. I have this rap about how, in traditional math, we don't think of numbers as knowing anything. We add 2 and 2 to get 4, but the number 2 is just a dumb number, and doesn't know diddly about adding. But in the object oriented world, things are a little different. I made the analogy to the movie 'The Incredibles.' The kids inherit super powers from the parents, and just need to look within to discover and develop them. Likewise... >>> dir(1) ['__abs__', '__add__', '__and__', '__class__', '__cmp__', '__coerce__', '__delattr__', '__div__', '__divmod__', '__doc__', '__float__', '__floordiv__', '__getattribute__', '__getnewargs__', '__hash__', '__hex__', '__init__', '__int__', '__invert__', '__long__', '__lshift__', '__mod__', '__mul__', '__neg__', '__new__', '__nonzero__', '__oct__', '__or__', '__pos__', '__pow__', '__radd__', '__rand__', '__rdiv__', '__rdivmod__', '__reduce__', '__reduce_ex__', '__repr__', '__rfloordiv__', '__rlshift__', '__rmod__', '__rmul__', '__ror__', '__rpow__', '__rrshift__', '__rshift__', '__rsub__', '__rtruediv__', '__rxor__', '__setattr__', '__str__', '__sub__', '__truediv__', '__xor__'] "Wow!" said one student. Like, we've asked '1' it to spill its guts about what it knows and it obviously knows quite a bit! And it knows all this because it inherits from type 'int', the type of 1: >>> type(1) Then I had each type their own name, with single quotes, and get the string to spill its guts about what any string type object already knows, right from the get go: >>> dir('kirby') ['__add__', '__class__', '__contains__', '__delattr__', '__doc__', '__eq__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__', '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__', '__str__', 'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'replace', 'rfind', 'rindex', 'rjust', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill'] "Wow!". I talked a lot about dot notation. We did 'import math' and math.pi and math.sqrt(n) -- stuff like that. There's a strong metaphor of containership. net.4dsolutions.satacad.sa6299. The 'net' domain, being top-level, is huge. Inside it, we find 4dsolutions, and inside that, other stuff. Likewise, with the math module: inside it, we find pi and sqrt. So then I relate this back to integer and string objects and encouraged them to paw through the raw dump of a string's capabilities for fun methods. I demonstrated up front: >>> 'kirby'.swapcase() 'KIRBY' >>> 'kirby'.title() 'Kirby' >>> 'kirby'.startswith('k') True and like that. Similar experiments with objects of type integer. Some initial discussion of the list type (much more next time). Then I went through my examples of open and closed source programs. Both play scissors, paper, rock (I had them eyeball commented code, just to get a quick feel for what more fluent Python looks like, quick rap on flow and control structures, Python's use of indentation in place of curly braces). However, in this example, the closed source version randomly cheats about a 3rd of the time, and so always wins in the long run. http://www.4dsolutions.net/satacad/lesson1/ I'm skipping over some of the other stuff I talked about. They heard a lot about Bob, Alice and Eve -- a sort of Garden of Eden story for cryptographers. Next week we'll do Euclid's Algorithm for the gcd, as we start building towards and intuitive understanding of RSA. I did go over the phi concept (number of totatives of an integer) and showed them the program for it in J, just so they could gawk at how different it looks (like something straight from the worlds in Myst or Uru): http://www.4dsolutions.net/ocn/graphics/phistone.jpg At the end, I handed out a page of URLs for optional followup (e.g. to the edu-sig page, also to porpig.org, currently unexciting but in Plone at least, which product I plugged, along with Zope -- also bittorrent). Signing up for Yahoo is not something any seemed familiar with, so probably will require parental approval/involvement. I emphasized that my Yahoo egroup for this course is entirely optional and they're under no pressure to join it -- just a resource I've decided to make available. I'm going to see how it goes as a closed list for awhile, before I decide whether to open it to subscribers from edu-sig. They know I manage the edu-sig web page @ python, so I think it'd eventually make sense to them to see that we're just one big happy family. Speaking of which, I did talk about Guido being the BDFL, and a Monty Python fan (hence so many of the allusions throughout). I also shared about how I fell in love with APL at Princeton in the 1970s (Iverson passed away recently, maybe some of you know). Kirby From ajsiegel at optonline.net Sun Jan 9 19:28:15 2005 From: ajsiegel at optonline.net (Arthur) Date: Sun Jan 9 19:31:28 2005 Subject: [Edu-sig] subprocess.py and the PyXR tool and site Message-ID: <1105295295.9801.41.camel@localhost.localdomain> Guess I'm just lucky. John Zelle focusing us (me) on some of the complexities of PyShell of Idle then my own issues runnning concurrent threads then getting interested in PyGTK and accessing and trying to follow 2 different scripts that use subprocesses and/or threads to allow one to experiment with creating PyGTK widgets from the command line and then deciding to dive in and go further with my PyGeo/Povray interface so that instead of simply exporting constructions to Povray scene defintion language, and then forcing users to leave PyGeo to render in povray and then use some kind of viewer to see what it is they have gotten, I would run povray as a subprocess to render and then return a rendered image using either Tk native image display facilities or some combo of Tk and PIL (like most of what I do with PyGeo I consider myself the primary user, and this is for me - I want to test the povray export of all my demos before I release and this was becoming a pain) and what if there are errors along the way from one of these attempts - how do I capture and communicate that? and with the backdrop of having some nagging doubt whether one can truly become a full fledged Python programmer without *first* being a C programmer and faced with distinguishing whether I need, in any case. popen2 popen3 popen4 execl execlp execlpe execvp execvpe fork spawnv spawnve spawnvp spawnvpe spawnl spawnle all of which are documented with some implicit assumption that one is a C programmer. comes the subprocess module, packaged with Python2.4 without much fanfare which seems to go a long way to abstracting all this away in a platform independent manner and seems to transform the process of subprocesses into something Pythonic, rather than a C-ic relic. And is some evidence against the accusation that the Python team has been too focused on core language and not enough on library support. Something that needed to get done, quietly got done, in any case, thanks. See - http://pyxr.sourceforge.net/PyXR/c/python24/lib/subprocess.py.html which is a node of the source of the entire Python lib created with PyXR. Something else that quietly got done, capable of transforming one's entire PYTHONPATH into nicely crosslinked HTML, and which has me for the first time actually reading library code as well as docs as a way of understanding module functionality. thanks again. Art From phillip.kent at gmail.com Sun Jan 9 19:36:52 2005 From: phillip.kent at gmail.com (Phillip Kent) Date: Sun Jan 9 19:34:59 2005 Subject: [Edu-sig] RAND corporation 1954 In-Reply-To: <20050109182145.D77D11E400B@bag.python.org> References: <20050107172358.7BDBE1E4003@bag.python.org> <20050109182145.D77D11E400B@bag.python.org> Message-ID: <6.2.0.14.2.20050109183312.04504af0@pop.gmail.com> An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/edu-sig/attachments/20050109/23296510/attachment.html From urnerk at qwest.net Sun Jan 9 21:08:47 2005 From: urnerk at qwest.net (Kirby Urner) Date: Sun Jan 9 21:08:51 2005 Subject: [Edu-sig] RAND corporation 1954 In-Reply-To: <6.2.0.14.2.20050109183312.04504af0@pop.gmail.com> Message-ID: <20050109200850.308AD1E400A@bag.python.org> Hah -- even better. I always wanted my own personal nuclear sub. I'll be sure to update my students. Kirby ________________________________________ From: edu-sig-bounces@python.org [mailto:edu-sig-bounces@python.org] On Behalf Of Phillip Kent Sent: Sunday, January 09, 2005 10:37 AM To: edu-sig@python.org Subject: Re: [Edu-sig] RAND corporation 1954 This does not invalidate Kirby's point, but for sake of veracity a colleague informed me that this photo is a hoax... *Online research can be easy, but beware of hoaxes* (!) "A hoax revealed: The e-mailed photograph, at left, was touted to be a 1954 projection of what a home computer would look like in 2004. The doctored image was actually altered from a photo, at right, of a 2000 Smithsonian Institution exhibit "Fast Attacks and Boomers: Submarines in the Cold War." The Smithsonian photo depicted a full-scale mock-up of a typical nuclear-powered submarine's control room."?? http://www.buffalonews.com/editorial/20041206/1019371.asp At 18:21 09/01/2005, Kirby Urner wrote: When they walk in, sometimes with a parent (parents don't get to stay though), they see a projected picture of a personal computer of 2004 -- as envisioned by some guy at the RAND corporation in 1954.? Here's the picture (from Popular Mechanics): http://www.4dsolutions.net/satacad/background/pc2004.jpg ++++++ Dr Phillip Kent, London, UK mathematics? education? technology? research phillip.kent@gmail.com? mobile: 07950 952034 ++++++ From delza at livingcode.org Sun Jan 9 21:29:39 2005 From: delza at livingcode.org (Dethe Elza) Date: Sun Jan 9 21:29:49 2005 Subject: [Edu-sig] subprocess.py and the PyXR tool and site In-Reply-To: <1105295295.9801.41.camel@localhost.localdomain> References: <1105295295.9801.41.camel@localhost.localdomain> Message-ID: <2FFAC5BF-627D-11D9-A0A3-0003939B59E8@livingcode.org> > comes the subprocess module, packaged with Python2.4 without much > fanfare Note that the subprocess module comes standard with Python 2.4, but it works just fine with 2.3 as well, you only need to download and install it. It is a very nice incremental step forward. --Dethe Ninety percent of the technology hasn't even been developed yet. --Tim Armstrong, Google -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2488 bytes Desc: not available Url : http://mail.python.org/pipermail/edu-sig/attachments/20050109/0ab93fb2/smime.bin From ajsiegel at optonline.net Sun Jan 9 21:51:24 2005 From: ajsiegel at optonline.net (Arthur) Date: Sun Jan 9 21:54:37 2005 Subject: [Edu-sig] subprocess.py and the PyXR tool and site In-Reply-To: <2FFAC5BF-627D-11D9-A0A3-0003939B59E8@livingcode.org> References: <1105295295.9801.41.camel@localhost.localdomain> <2FFAC5BF-627D-11D9-A0A3-0003939B59E8@livingcode.org> Message-ID: <1105303884.12040.8.camel@localhost.localdomain> On Sun, 2005-01-09 at 12:29 -0800, Dethe Elza wrote: > > comes the subprocess module, packaged with Python2.4 without much > > fanfare > > Note that the subprocess module comes standard with Python 2.4, but it > works just fine with 2.3 as well, you only need to download and install > it. It is a very nice incremental step forward. > True. This is what I am doing on ubuntu. I think as to Windows there is an extension piece. I am gathering that effbot has a Window's binary for 2.3, but www.effbot.org seems to be down at the moment. Art From ajsiegel at optonline.net Mon Jan 10 00:45:57 2005 From: ajsiegel at optonline.net (Arthur) Date: Mon Jan 10 00:49:12 2005 Subject: [Edu-sig] subprocess.py and the PyXR tool and site In-Reply-To: <1105303884.12040.8.camel@localhost.localdomain> References: <1105295295.9801.41.camel@localhost.localdomain> <2FFAC5BF-627D-11D9-A0A3-0003939B59E8@livingcode.org> <1105303884.12040.8.camel@localhost.localdomain> Message-ID: <1105314357.4118.3.camel@localhost.localdomain> On Sun, 2005-01-09 at 15:51 -0500, Arthur wrote: > On Sun, 2005-01-09 at 12:29 -0800, Dethe Elza wrote: > > > comes the subprocess module, packaged with Python2.4 without much > > > fanfare > > > > Note that the subprocess module comes standard with Python 2.4, but it > > works just fine with 2.3 as well, you only need to download and install > > it. It is a very nice incremental step forward. > > > > True. This is what I am doing on ubuntu. > > I think as to Windows there is an extension piece. I am gathering that > effbot has a Window's binary for 2.3, but www.effbot.org seems to be > down at the moment. FWIW, where I end up ending up: problems with the effbot binary extensions for Python23 on Windows but the extension is in lieu of having win32all installed, which I do, so I find that subprocess.py does run of Windows for Python23 assuming win32all installed. Art > Art > > From urnerk at qwest.net Mon Jan 10 02:04:41 2005 From: urnerk at qwest.net (Kirby Urner) Date: Mon Jan 10 02:04:43 2005 Subject: [Edu-sig] Tim's Pylosxom blog In-Reply-To: <1105314357.4118.3.camel@localhost.localdomain> Message-ID: <20050110010442.5B3401E400A@bag.python.org> http://frbob.kmg.is-a-geek.org/ is really looking good these days wouldn't you say? Tim is doing this for Father Bob, a priest, which explains why there's a lot of new imported content. Kirby From ajsiegel at optonline.net Mon Jan 10 19:15:42 2005 From: ajsiegel at optonline.net (ajsiegel@optonline.net) Date: Mon Jan 10 19:16:30 2005 Subject: [Edu-sig] Building the School of the Future (Microsoft style) Message-ID: <36316d35dde0.35dde036316d@optonline.net> It will be interesting to follow developments here: http://www.microsoft.com/education/schooloffuture.aspx Needless to say, I have my concerns. - technology becoming disruptive of the traditional understanding of the appropriate relationship between the business enterprise and public education. I feel it necessary to comment that I am not anti-Microsft in the sense that might be assumed by expressing my concerns here. And one could argue that disruption of/to a failing system can only be for the good. I think that there are deeper reasons to believe that this is a from the frying pan, into the fire situation. Art From mrmrmr50 at yahoo.com Tue Jan 11 19:06:31 2005 From: mrmrmr50 at yahoo.com (mike re-v) Date: Tue Jan 11 19:06:34 2005 Subject: [Edu-sig] Re: Edu-sig Digest, Vol 18, Issue 10 In-Reply-To: <20050111110003.03E331E400A@bag.python.org> Message-ID: <20050111180631.67977.qmail@web21207.mail.yahoo.com> --- ededuisigequest@python.ororgrote: > Send EdEduisigailing list submissions to > ededuisigython.ororg> > To subscribe or ununsubscribeia the World Wide Web, > visit > hthttp/mail.python.ororgailman/lilistinfodeduisig> or, via email, send a message with subject or body > 'help' to > ededuisigequest@python.ororg> > You can reach the person managing the list at > ededuisigwner@python.ororg> > When replying, please edit your Subject line so it > is more specific > than "Re: Contents of EdEduisigigest..." > > > Today's Topics: > > 1. Building the School of the Future (Microsoft > style) > (ajajsiegelpoptonlineet) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 10 Jan 2005 13:15:42 -0500 > From: ajajsiegelpoptonlineet > Subject: [EdEduisigBuilding the School of the Future > (Microsoft style) > To: ededuisigython.ororg> Message-ID: > <36316d35dddde35dddde6316d@opoptonlineet> > Content-Type: text/plain; chcharsets-asascii> > > It will be interesting to follow developments here: > > hthttp/wwwwwimicrosoftom/education/scschooloffuturesaspx> > Needless to say, I have my concerns. > > - technology becoming disruptive of the traditional > understanding of the appropriate relationship > between the business enterprise and public > education. > As a school librarian, I'm totally against any software which limits equity of access and seeks to hide common knowledge. > I feel it necessary to comment that I am not > anti-MiMicrosftn the sense that might be assumed by > expressing my concerns here. > > And one could argue that disruption of/to a failing > system can only be for the good. I taught in Phila from 1998-2002. Failing schools, I don't but it. A failing system, too smug an answer for a problem rooted in prejudice. > > I think that there are deeper reasons to believe > that this is a from the frying pan, into the fire > situation. Not sure what you mean here? I think requiring 45 mil. from MS to offer its product to one high school in a school district might be a step in the right direction. If MS wants to have a school district use their products, of course, they should pay a heavy royalty fee. Just as Coke, Pepsi or any other corporation does. re-v > > Art > > > > > > ------------------------------ > > _______________________________________________ > EdEduisigailing list > EdEduisigython.ororg> hthttp/mail.python.ororgailman/lilistinfodeduisig> > > End of EdEduisigigest, Vol 18, Issue 10 > *************************************** > __________________________________ Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail From H.FANGOHR at soton.ac.uk Tue Jan 11 20:31:06 2005 From: H.FANGOHR at soton.ac.uk (Hans Fangohr) Date: Tue Jan 11 20:31:03 2005 Subject: [Edu-sig] IDLE and Matplotlib In-Reply-To: <36316d35dde0.35dde036316d@optonline.net> References: <36316d35dde0.35dde036316d@optonline.net> Message-ID: Dear all, I am about to teach Python to a number of students who already know how to use Matlab (on a basic level). For that reason, the matplotlib library for plotting curves is ideally suited (it seems quite good anyway). The teaching computers are Win XP machines. I have settled for the Enthough Python Edition and the latest matplotlib (both executables can be found in www.soton.ac.uk/~fangohr/download/python). I have prepared the exercises on linux and am now trying to run them in windows. This is where I realised that matplotlib doesn't work well with IDLE. More particularly, it is known that the default backend TkAgg doesn't work with IDLE (see here http://matplotlib.sourceforge.net/backends.html#TkAgg) but it appears to work with "IDLE -n" (this is what it says on that web page). The problem I experience is this: -start idle -execute these commands: import pylab pylab.plot(range(10)) pylab.show() This produces a figure window which seems to work fine. At this point when closing the figure window, I can't get the IDLE prompt active again. (It seems that IDLE thinks the program and the figure process are still running, and is waiting for control to return.) This, in itself, is maybe not suprising. However, the idle -n switch doesn't seem to solve the problem for me (see below). The same problem is observed when I execute a program in the IDLE editor (by pressing F5). What do people think how I should continue? I could - try to make IDLE work with matplotlib (I think this is my preferred option) In that case, how do I tell IDLE on Windows to start with -n? (Not a Windows freak). In the start menu, I can change the properties for the link to idle from ''' C:\Python23\pythonw.exe "C:\Python23\Lib\idlelib\idle.pyw" C:\Python23\pythonw.exe "C:\Python23\Lib\idlelib\idle.pyw" "-n" but this doesn't seem to solve the problem: I get exactly the same behaviour as described above. - go to a completely different environment such as ipython. I am not too keen on this as the IDLE environment looks for familiar to the students - suggest to run their programs by doubleclicking on them if they use matplotlib. This seems very ugly considering that you edit the file in the IDLE editor but you can't use it to execute the program. This is my backup solution. I have addressed the matplotlib mailing list but am not to optimistic. Does anyone have some experience with IDLE, matplotlib and IDLE on Windows machines? Thanks, Hans ------------------------------------------------- Dr Hans Fangohr Computational Engineering & Design Research Group School of Engineering Sciences University of Southampton Southampton, SO17 1BJ United Kingdom Location: Building 25, Room 1027 phone : +44 (0) 23 8059 8345 fax : +44 (0) 23 8059 7082 email : fangohr@soton.ac.uk ------------------------------------------------- From ajsiegel at optonline.net Tue Jan 11 21:44:48 2005 From: ajsiegel at optonline.net (ajsiegel@optonline.net) Date: Tue Jan 11 21:44:59 2005 Subject: [Edu-sig] Re: Edu-sig Digest, Vol 18, Issue 10 Message-ID: <5021c7504281.5042815021c7@optonline.net> re-v > I taught in Phila from 1998-2002. Failing schools, I > don't but it. A failing system, too smug an answer for > a problem rooted in prejudice. Not sure why smug. I'm not doubting that race is an issue/factor. But are the lily white shcools not failing? I guess its a matter of degree and and definition. > > > > I think that there are deeper reasons to believe > > that this is a from the frying pan, into the fire > > situation. > Not sure what you mean here? I think requiring 45 > mil. from MS to offer its product to one high school > in a school district might be a step in the right > direction. If MS wants to have a school district use > their products, of course, they should pay a heavy > royalty fee. Just as Coke, Pepsi or any other > corporation does. Well mr. re-v. I assure you that MS is not in the business of paying 45m in fees to have a school use 50k worth of their software. So this is not repeatable sustainable model, by a long,long shot. Isn't that clear? On the other hand I have no reason to believe that MS would have undertaken this if there was not to be an anticipated long-term return on their investment. What do you think the game plan is? Art From H.FANGOHR at soton.ac.uk Tue Jan 11 22:49:17 2005 From: H.FANGOHR at soton.ac.uk (Hans Fangohr) Date: Tue Jan 11 22:49:14 2005 Subject: [Edu-sig] Re: IDLE and Matplotlib In-Reply-To: References: <36316d35dde0.35dde036316d@optonline.net> Message-ID: Dear all, The problem with IDLE and matplotlib might be bug which seems to be solveable (just got feedback from Matplotlib developers). I will post a summary here in a few days. Thanks, Hans On Tue, 11 Jan 2005, Hans Fangohr wrote: > Dear all, > > I am about to teach Python to a number of students who already know how to > use Matlab (on a basic level). For that reason, the matplotlib library for > plotting curves is ideally suited (it seems quite good anyway). > > The teaching computers are Win XP machines. I have settled for the Enthough > Python Edition and the latest matplotlib (both executables can be found in > www.soton.ac.uk/~fangohr/download/python). > > I have prepared the exercises on linux and am now trying to run them in > windows. This is where I realised that matplotlib doesn't work well with > IDLE. > > More particularly, it is known that the default backend TkAgg doesn't work > with IDLE (see here http://matplotlib.sourceforge.net/backends.html#TkAgg) > but it appears to work with "IDLE -n" (this is what it says on that web > page). > > The problem I experience is this: > > -start idle > -execute these commands: > > import pylab > pylab.plot(range(10)) > pylab.show() > > This produces a figure window which seems to work fine. > > At this point when closing the figure window, I can't get the IDLE prompt > active again. (It seems that IDLE thinks the program and the figure process > are still running, and is waiting for control to return.) > > This, in itself, is maybe not suprising. However, the idle -n switch doesn't > seem to solve the problem for me (see below). > > The same problem is observed when I execute a program in the IDLE editor (by > pressing F5). > > What do people think how I should continue? > > I could > > - try to make IDLE work with matplotlib (I think this is my preferred > option) > In that case, how do I tell IDLE on Windows to start with -n? (Not a > Windows freak). In the start menu, I can change the properties for the > link to idle from ''' > > C:\Python23\pythonw.exe "C:\Python23\Lib\idlelib\idle.pyw" > > C:\Python23\pythonw.exe "C:\Python23\Lib\idlelib\idle.pyw" "-n" > > but this doesn't seem to solve the problem: I get exactly the same > behaviour as described above. > > - go to a completely different environment such as ipython. I am not > too keen on this as the IDLE environment looks for familiar to the > students > > - suggest to run their programs by doubleclicking on them if they > use matplotlib. This seems very ugly considering that you edit the file > in the IDLE editor but you can't use it to execute the program. > > This is my backup solution. > > > I have addressed the matplotlib mailing list but am not to optimistic. > > Does anyone have some experience with IDLE, matplotlib and IDLE on Windows > machines? > > > > Thanks, > > Hans > > > > > > > > > > > > ------------------------------------------------- > Dr Hans Fangohr > > Computational Engineering & Design Research Group > School of Engineering Sciences > University of Southampton > Southampton, SO17 1BJ > United Kingdom > > Location: Building 25, Room 1027 > phone : +44 (0) 23 8059 8345 > fax : +44 (0) 23 8059 7082 > email : fangohr@soton.ac.uk > ------------------------------------------------- > > ------------------------------------------------- Dr Hans Fangohr Computational Engineering & Design Research Group School of Engineering Sciences University of Southampton Southampton, SO17 1BJ United Kingdom Location: Building 25, Room 1027 phone : +44 (0) 23 8059 8345 fax : +44 (0) 23 8059 7082 email : fangohr@soton.ac.uk ------------------------------------------------- From john.zelle at wartburg.edu Wed Jan 12 02:17:01 2005 From: john.zelle at wartburg.edu (John Zelle) Date: Wed Jan 12 02:18:05 2005 Subject: [Edu-sig] IDLE and Matplotlib In-Reply-To: References: <36316d35dde0.35dde036316d@optonline.net> Message-ID: <41E47A8D.8060308@wartburg.edu> Hans, I know you are already in communication/waiting for a bugfix on this, but I have a quick inquiry. This sounds related to issues I've had with my graphics library (now solved, knock on wood). I would think that running IDLE -n would solve this problem for you. Please see my question below: Hans Fangohr wrote: > Dear all, > > I am about to teach Python to a number of students who already know > how to use Matlab (on a basic level). For that reason, the matplotlib > library for plotting curves is ideally suited (it seems quite good > anyway). > > The teaching computers are Win XP machines. I have settled for the > Enthough Python Edition and the latest matplotlib (both executables > can be found in www.soton.ac.uk/~fangohr/download/python). > > I have prepared the exercises on linux and am now trying to run them > in windows. This is where I realised that matplotlib doesn't work well > with IDLE. > > More particularly, it is known that the default backend TkAgg doesn't > work with IDLE (see here > http://matplotlib.sourceforge.net/backends.html#TkAgg) > but it appears to work with "IDLE -n" (this is what it says on that > web page). > > The problem I experience is this: > > -start idle > -execute these commands: > > import pylab > pylab.plot(range(10)) > pylab.show() > > This produces a figure window which seems to work fine. > > At this point when closing the figure window, I can't get the IDLE > prompt active again. (It seems that IDLE thinks the program and the > figure process are still running, and is waiting for control to return.) > > This, in itself, is maybe not suprising. However, the idle -n switch > doesn't seem to solve the problem for me (see below). > > The same problem is observed when I execute a program in the IDLE > editor (by pressing F5). > > What do people think how I should continue? > > I could > > - try to make IDLE work with matplotlib (I think this is my preferred > option) > In that case, how do I tell IDLE on Windows to start with -n? (Not a > Windows freak). In the start menu, I can change the properties for the > link to idle from ''' > > C:\Python23\pythonw.exe "C:\Python23\Lib\idlelib\idle.pyw" > > C:\Python23\pythonw.exe "C:\Python23\Lib\idlelib\idle.pyw" "-n" > > but this doesn't seem to solve the problem: I get exactly the same > behaviour as described above. When you say you get exactly the same result, does this mean that IDLE's behavior is unchanged? If so, you are not getting the -n flag set. IDLE should fire up with a message that simply says "no subprocess" instead of the warning about personal firewalls. If you just mean that Matplotlib acts the same, that's a different story. What happens if you change the menu item to this: C:\Python23\pythonw.exe "C:\Python23\Lib\idlelib\idle.pyw -n" Unfortunately, I don't have access to Windows to try this out at the moment. Another way to fire up IDLE in the -n mode is to right-click on a Python file and then select "edit with IDLE." I actually find it annoying that opening IDLE this way puts it in -n mode, but it might be a way to test out exactly what's happening. > > _______________________________________________ > Edu-sig mailing list > Edu-sig@python.org > http://mail.python.org/mailman/listinfo/edu-sig > > From H.FANGOHR at soton.ac.uk Wed Jan 12 17:00:11 2005 From: H.FANGOHR at soton.ac.uk (Hans Fangohr) Date: Wed Jan 12 17:00:31 2005 Subject: [Edu-sig] IDLE and Matplotlib In-Reply-To: <41E47A8D.8060308@wartburg.edu> References: <36316d35dde0.35dde036316d@optonline.net> <41E47A8D.8060308@wartburg.edu> Message-ID: Hi John, > I know you are already in communication/waiting for a bugfix on this, but I > have a quick inquiry. This sounds related to issues I've had with my graphics > library (now solved, knock on wood). I would think that running IDLE -n would > solve this problem for you. Please see my question below: > > Hans Fangohr wrote: > >> Dear all, >> >> I am about to teach Python to a number of students who already know how >> to use Matlab (on a basic level). For that reason, the matplotlib library >> for plotting curves is ideally suited (it seems quite good anyway). >> >> The teaching computers are Win XP machines. I have settled for the >> Enthough Python Edition and the latest matplotlib (both executables can >> be found in www.soton.ac.uk/~fangohr/download/python). >> >> I have prepared the exercises on linux and am now trying to run them in >> windows. This is where I realised that matplotlib doesn't work well with >> IDLE. >> >> More particularly, it is known that the default backend TkAgg doesn't >> work with IDLE (see here >> http://matplotlib.sourceforge.net/backends.html#TkAgg) >> but it appears to work with "IDLE -n" (this is what it says on that web >> page). >> >> The problem I experience is this: >> >> -start idle >> -execute these commands: >> >> import pylab >> pylab.plot(range(10)) >> pylab.show() >> >> This produces a figure window which seems to work fine. >> >> At this point when closing the figure window, I can't get the IDLE prompt >> active again. (It seems that IDLE thinks the program and the figure >> process are still running, and is waiting for control to return.) >> >> This, in itself, is maybe not suprising. However, the idle -n switch >> doesn't seem to solve the problem for me (see below). >> >> The same problem is observed when I execute a program in the IDLE editor >> (by pressing F5). >> >> What do people think how I should continue? >> >> I could >> >> - try to make IDLE work with matplotlib (I think this is my preferred >> option) >> In that case, how do I tell IDLE on Windows to start with -n? (Not a >> Windows freak). In the start menu, I can change the properties for the >> link to idle from ''' >> >> C:\Python23\pythonw.exe "C:\Python23\Lib\idlelib\idle.pyw" >> >> C:\Python23\pythonw.exe "C:\Python23\Lib\idlelib\idle.pyw" "-n" >> >> but this doesn't seem to solve the problem: I get exactly the same >> behaviour as described above. > > When you say you get exactly the same result, does this mean that IDLE's > behavior is unchanged? Sorry I was inprecise. In fact, yesterday I didn't know what to look for (it is the 'no subproccess message'). What I meant with 'exactly the same result' was that IDLE hangs after I closed the figure window. I can now confirm that the syntax I used above, i.e. C:\Python23\pythonw.exe "C:\Python23\Lib\idlelib\idle.pyw" "-n" is correct to start Python with no subprocesses. > If so, you are not getting the -n flag set. IDLE > should fire up with a message that simply says "no subprocess" instead of the > warning about personal firewalls. If you just mean that Matplotlib acts the > same, that's a different story. What happens if you change the menu item to > this: > > C:\Python23\pythonw.exe "C:\Python23\Lib\idlelib\idle.pyw -n" This, by the way, results in a 'program not found error' presumably because pythonw is looking for a program of name "C:\Python23\Lib\idlelib\idle.pyw -n". > Unfortunately, I don't have access to Windows to try this out at the moment. > Another way to fire up IDLE in the -n mode is to right-click on a Python file > and then select "edit with IDLE." I actually find it annoying that opening > IDLE this way puts it in -n mode, but it might be a way to test out exactly > what's happening. That's useful information for me, thanks. To complete the story: the matplotlib people (John Hunter and Todd Miller) have been very helpful. They suggested to uncomment this line #os.environ['PYTHONINSPECT'] = '1' in the show method of site-packages/matplotlib/backends/backend_tkagg.py, and to use the interactive mode (i.e. set interactive=True in share/matplotlib/.matplotlibrc). Having done that, all works well when IDLE is started with the -n flag. (which -- as it happens seems to be identical to rightclick on a Python file and select 'edit with idle'.) Hope this is useful, Hans > > > >> >> _______________________________________________ >> Edu-sig mailing list >> Edu-sig@python.org >> http://mail.python.org/mailman/listinfo/edu-sig >> >> > _______________________________________________ > Edu-sig mailing list > Edu-sig@python.org > http://mail.python.org/mailman/listinfo/edu-sig > ------------------------------------------------- Dr Hans Fangohr Computational Engineering & Design Research Group School of Engineering Sciences University of Southampton Southampton, SO17 1BJ United Kingdom Location: Building 25, Room 1027 phone : +44 (0) 23 8059 8345 fax : +44 (0) 23 8059 7082 email : fangohr@soton.ac.uk ------------------------------------------------- From urnerk at qwest.net Sun Jan 16 17:55:18 2005 From: urnerk at qwest.net (Kirby Urner) Date: Sun Jan 16 17:55:23 2005 Subject: [Edu-sig] python satacad: class 2 (rescheduled) In-Reply-To: <20050109182145.D77D11E400B@bag.python.org> Message-ID: <20050116165521.8A5411E4003@bag.python.org> Ice storm in PDX on 2004.1.15 caused us to cancel Saturday Academy classes across the board. I was going to (and will, next time) show how Python is used to support the generation of VRML files using these utilities: http://packinon.sourceforge.net/ Since this is a Win2000 lab, we're able to use Cortona, a top notch freeware VRML viewer. AFAIK, Linuxworld lags, in terms of having state-of-the-art VRML plugins. I wish Cortona'd port theirs, even if they kept it closed source. Another item on my calendar: two 1.5 hr Python classes for a GIS company, Double Tree hotel, Lloyd Center, PDX, March 28. I'll need to demo some of the win32all stuff, e.g. using the ADO API to pull a RecordSet from MSFT Access. Fortunately, this stuff is all well documented and easy to show. Mostly, I'll just be going over core Python, using 2.4.x on WinXP (I like to set up a shell and an importable/reloadable code window side by side, and do live interactions -- more interesting than PowerPoint IMO). Kirby From ggbaker at cs.sfu.ca Fri Jan 21 21:54:25 2005 From: ggbaker at cs.sfu.ca (Greg Baker) Date: Fri Jan 21 21:54:29 2005 Subject: [Edu-sig] IDLE refusing to run Message-ID: <1106340864.1325.15.camel@lefty> We have had complaints from a few students running Python under Windows that they can't get things running. All seem to take the form: 1. At some point, Python/IDLE under Windows crashed. 2. IDLE won't run at all after that. 3. The regular interpreter will run (python.exe). 4. Uninstalling/reinstalling doesn't help. Does anybody have any idea what to do about this? (Or who to ask?) I haven't been able to reproduce it to test, but it has happened to several students independantly. -- Greg Baker, Lecturer School of Computing Science Simon Fraser University Burnaby, BC, V5A 1S6 E-mail: ggbaker@cs.sfu.ca From gvanrossum at gmail.com Fri Jan 21 22:16:38 2005 From: gvanrossum at gmail.com (Guido van Rossum) Date: Fri Jan 21 22:16:43 2005 Subject: [Edu-sig] IDLE refusing to run In-Reply-To: <1106340864.1325.15.camel@lefty> References: <1106340864.1325.15.camel@lefty> Message-ID: Here's something that usually works for me. Hit Ctrl-Alt-Del and select the process list (task manager). Look for a process named pythonw.exe (the 'w' is essential). Terminate it. Then IDLE should run again. On Fri, 21 Jan 2005 12:54:25 -0800, Greg Baker wrote: > We have had complaints from a few students running Python under Windows > that they can't get things running. All seem to take the form: > 1. At some point, Python/IDLE under Windows crashed. > 2. IDLE won't run at all after that. > 3. The regular interpreter will run (python.exe). > 4. Uninstalling/reinstalling doesn't help. > > Does anybody have any idea what to do about this? (Or who to ask?) I > haven't been able to reproduce it to test, but it has happened to > several students independantly. > > -- > Greg Baker, Lecturer > School of Computing Science > Simon Fraser University > Burnaby, BC, V5A 1S6 > E-mail: ggbaker@cs.sfu.ca > > _______________________________________________ > Edu-sig mailing list > Edu-sig@python.org > http://mail.python.org/mailman/listinfo/edu-sig > -- --Guido van Rossum (home page: http://www.python.org/~guido/) From john.zelle at wartburg.edu Fri Jan 21 22:31:28 2005 From: john.zelle at wartburg.edu (John Zelle) Date: Fri Jan 21 22:32:19 2005 Subject: [Edu-sig] IDLE refusing to run In-Reply-To: References: <1106340864.1325.15.camel@lefty> Message-ID: <41F174B0.5010309@wartburg.edu> Just for further information on this, the newest versions of IDLE (1.1 for sure and 1.04 I think), have improved messages about what is going on when IDLE won't start due to the socket being in use (from the hanging process). One thing that causes IDLE to crash in this bad way is when a student kills the shell window when the program that it is executing is waiting for interactive input. This is a bug for which a patch is now available, but has not yet been incorporated into the Python release. You can get a fix for this particular problem from my page: http://mcsp.wartburg.ed/zelle/python The information on patching IDLE is at the very bottom. I think with this patch IDLE has become quite stable again under Windows. Sadly, I'm now having troubles with random lock-ups when running on a Debian Linux Testing distribution. I think it's a problem with one of the Debian libraries, but have not yet been able to pin it down. --John Guido van Rossum wrote: >Here's something that usually works for me. > >Hit Ctrl-Alt-Del and select the process list (task manager). Look for >a process named pythonw.exe (the 'w' is essential). Terminate it. Then >IDLE should run again. > >On Fri, 21 Jan 2005 12:54:25 -0800, Greg Baker wrote: > > >>We have had complaints from a few students running Python under Windows >>that they can't get things running. All seem to take the form: >> 1. At some point, Python/IDLE under Windows crashed. >> 2. IDLE won't run at all after that. >> 3. The regular interpreter will run (python.exe). >> 4. Uninstalling/reinstalling doesn't help. >> >>Does anybody have any idea what to do about this? (Or who to ask?) I >>haven't been able to reproduce it to test, but it has happened to >>several students independantly. >> >>-- >>Greg Baker, Lecturer >>School of Computing Science >>Simon Fraser University >>Burnaby, BC, V5A 1S6 >>E-mail: ggbaker@cs.sfu.ca >> >>_______________________________________________ >>Edu-sig mailing list >>Edu-sig@python.org >>http://mail.python.org/mailman/listinfo/edu-sig >> >> >> > > > > From urnerk at qwest.net Sun Jan 23 06:48:47 2005 From: urnerk at qwest.net (Kirby Urner) Date: Sun Jan 23 06:48:50 2005 Subject: [Edu-sig] python satacad: class 2 (rescheduled) In-Reply-To: <20050116165521.8A5411E4003@bag.python.org> Message-ID: <20050123054849.7D06A1E4002@bag.python.org> > Ice storm in PDX on 2004.1.15 caused us to cancel Saturday Academy classes > across the board. I was going to (and will, next time) show how Python is > used to support the generation of VRML files using these utilities: > http://packinon.sourceforge.net/ > 2004.1.22: good class today; everyone showed. Mostly just went over core Python, with an eye to developing reading fluency. As with any language, reading code is easier than writing it -- and we did some of that too. Focused on data structures and class/object syntax. Dog and Monkey subclasses of Animal. self.state set to 'sleep' by sleep() method, and if you ask a monkey to swing while asleep, it falls out of its tree. Dog barks random number of times (investigated randint and shuffle in response to cues from students). I'm pretty strong on "everything is an object" paradigm in that I'm careful to link dot-notation vis-?-vis both builtin types and user types, i.e. Python revolves around core types, and is extensible by the user. Also: I updated the class re that 'pc of the future' really being some old sub bridge mockup. VRML demo was inspiring, including tour of Eden Project using Quicktime VR (in addition to the VRML). However, command line use of Adrian's polyform.py dies on a popen3 method with 'broken pipe' error (I found this out before class -- not a show stopper in any way). I'm thinking this might be specific to Win2000, as I've never encountered this on WinXP. The optional Yahoo group has only been joined by one student. As I've stressed its being entirely optional, I'm not stressed that it's not really flying at this time. Ate a large amount of sushi after class, at one of those conveyor belt places. Good feature of Beaverton, Oregon is that Asian food establishments tend to be staffed and patronized by bona fide Asians, meaning they don't dumb it down or cut a lot of corners. Just your basic, yummy, all American sushi. Kirby From ajsiegel at optonline.net Sun Jan 23 21:13:54 2005 From: ajsiegel at optonline.net (Arthur) Date: Sun Jan 23 21:16:16 2005 Subject: [Edu-sig] Just some stuff Message-ID: <0IAS00BCSDMSEX@mta2.srv.hcvlny.cv.net> Some random stuff... Sean McGrath, who I recommend, recommends Online Python for beginners book - A Byte of Python http://www.byteofpython.info/ I'm blizzarded in. A good excuse to get stuff done with PyGeo. And it happens that the issues I needed to solve were solved with the help of edu-sig members. PyGeo has the concept of "levels", whereby layers of a construction can be revealed or hidden - controlled by Tkinter Checkbuttons. But the fact that tkinter event commands cannot take arguments had me hemmed in, and rather than write a separate function for each checkbox (which seemed quite ugly) I had chosen an inefficient redraw of the entire construction anytime any of the checkboxes was changed (as the lesser of the evils, until next refactoring). We are at next refactoring. Scott David Daniels cookbook recipe at http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52549 led me to a few line solution. Look mom, I'm currying ;) Then... If I'm going to control povray rendering from the PyGeo interface, I may as well pull up the rendered image and see what it is I've gotten. I stay within tkinter and am content to give control to the image display until it is closed, so no thread or subprocesses issues anticipated. Sounded simply enough. Except that I kept pulling up nice pictures of nothing. This exchange of Gregor Lingl on tutor-list dug me out. http://starship.python.net/pipermail/python-de/2002q4/002838.html Needed a "global" statement. Sad but true. Thanks, Art From ajsiegel at optonline.net Mon Jan 24 14:27:49 2005 From: ajsiegel at optonline.net (Arthur) Date: Mon Jan 24 14:29:59 2005 Subject: [Edu-sig] Just some stuff In-Reply-To: <0IAS00BCSDMSEX@mta2.srv.hcvlny.cv.net> Message-ID: <0IAT004M2PHWHZ@mta4.srv.hcvlny.cv.net> I had mentioned... > > If I'm going to control povray rendering from the PyGeo interface Sadly, I'm ready to abandon this effort, or at least the effort at making it crossplatform, or at least the hope of getting Windows to act predictably. Its hard not to blame Windows both as an operating system and as closed source software which lets us know what it wants us to know and no more. I seem to get different behaviors at different runs of the same code. Or else small modifications of codes are having strangely unpredictable impacts. Or else it might depend on what else I happen to have open at the time, and what resources it happens to be consuming. The real point is that there doesn't seem to be anywhere to turn to understand what is happening, and I consider myself pretty good at researching this kind of thing. If one were working with the Python Windows extensions, and thereby within the framework of the officially exposed Windows API, I suspect things would be otherwise. I am gathering that the subprocess.py module is an attempt to do so and then abstract things back to crossplatform functionality. But I'm not sure its there yet. Not totally OT, IMO. John Zelle expresses some deep concerns in connection with the instability of Idle and the impact of that on his efforts, and presumably others like it. True Idle is trying to do much more complex things at the thread, socket, subprocess level than anything I am attempting - but the folks working at it have orders of magnitude more expertise, and still have trouble achieving crossplatform stability. And crossplatform stability seems to me to mean here getting Windows to work reliably without so many contortions as to confuse other platforms - where I think the solutions would otherwise be straightforward. Jim Huginin, now of Microsoft, will be talking at PyCon on his IronPython project to bring Python to .Net - which will be interesting. With .Net, the burden of achieving crossplatform functionality will shift to the Open Source folks, through Mono and the like. And will probably be better realized, as a result. It is hard not to think of .Net as Microsoft in some sense abandoning there own operating system. Which may be an expression of integrity of its own kind. Art From urnerk at qwest.net Tue Jan 25 16:47:54 2005 From: urnerk at qwest.net (Kirby Urner) Date: Tue Jan 25 16:47:56 2005 Subject: [Edu-sig] Just some stuff In-Reply-To: <0IAT004M2PHWHZ@mta4.srv.hcvlny.cv.net> Message-ID: <20050125154754.597891E4002@bag.python.org> Hey Arthur, I know you're shooting for more seamless integration of PyGeo and POV-Ray, but at least you should be able to get away with a loose coupling via an ordinary os.system() call. I've long used such code from IDLE e.g. something like: From urnerk at qwest.net Tue Jan 25 16:56:44 2005 From: urnerk at qwest.net (Kirby Urner) Date: Tue Jan 25 16:56:55 2005 Subject: [Edu-sig] Just some stuff In-Reply-To: <0IAT004M2PHWHZ@mta4.srv.hcvlny.cv.net> Message-ID: <20050125155654.F23011E4002@bag.python.org> Hey Arthur, I know you're shooting for more seamless integration of PyGeo and POV-Ray, but at least you should be able to get away with a loose coupling via an ordinary os.system() call. I've long used such code from IDLE e.g. something like: [$%!!*, that post got away from me -- stupid keystroke shortcuts...] Something like: import os def render(filename="default.pov"): if os.name == 'linux2': linuxcomm = "povray +V +W640 +H480 +FN16 +AM2 +Q9 +A0.3 +P L/home/urnerk/include" print "Rendering... (this will take some time)" os.system(linuxcomm+" +I"+filename) if os.name == 'nt': wincomm = '"c:\\program files\\POV-Ray for Windows v3.5\\bin\\pvengine" -V fpp.ini' print "Rendering... (this will take some time)" os.system(wincomm) Certainly if you're able to frame a shot in Pygeo and then feed it to a POV-Ray camera for rendering, that'd be a useful feature (maybe you have it already). Users of Springdance certainly appreciate and make good use of that feature, and of Struck (which'd export full-fledged animations, using POV-Ray's clock-driven looping feature). If you've not used Springdance, I recommend adding it to your interactive geometry toolkit -- but it only runs in Windows (coded in Delphi): http://shapeofspace.org/springdance/ Related blog link: http://worldgame.blogspot.com/2004/11/canadian-tech-springdance.html Kirby From ajsiegel at optonline.net Tue Jan 25 18:15:15 2005 From: ajsiegel at optonline.net (ajsiegel@optonline.net) Date: Tue Jan 25 18:16:34 2005 Subject: [Edu-sig] Just some stuff Message-ID: <11c28dd11c328f.11c328f11c28dd@optonline.net> Hi Kirby - Attempting this has been a good learning exercise, as I am trying to make it as much like a "real" application as possible. For example, I don't assume a location (more importantly a particular version) of Povray, but get it from the registry using winreg, and add the location derived from the registry to the path. My problems (now at least temporarily solved) had to do with timing, performance and catching and reporting errors. PyGeo is opened and consuming resources - and as you know Povray rendering is resource intensive. Timing wise, PyGeo has to know to wait for povray to finish rendering before trying to retrieve and display the rendered image. And I was getting wildly varying performance - sometimes the PyGeo resource consumption seems to be released before the rendering starts, sometimes not. Piping povray errors to Pygeo doesn't seem to be an option on Windows (as far as I can understand), so that I am settling for writing to an error file. I'm sure the issues here are knowable - I just don't know them. And working on Windows, I guess I getted a bit psyched-out. It's a mind set one gets into, more than anything - from the lack of transparency. As it turns out there was more stupidity than I like to admit at the bottom of the problems frustrating me in getting this done. Art - Original Message ----- From: Kirby Urner Date: Tuesday, January 25, 2005 10:56 am Subject: RE: [Edu-sig] Just some stuff > > Hey Arthur, I know you're shooting for more seamless integration > of PyGeo > and POV-Ray, but at least you should be able to get away with a loose > coupling via an ordinary os.system() call. I've long used such > code from > IDLE e.g. something like: > > [$%!!*, that post got away from me -- stupid keystroke shortcuts...] > > Something like: > > import os > > def render(filename="default.pov"): > if os.name == 'linux2': > linuxcomm = "povray +V +W640 +H480 +FN16 +AM2 +Q9 +A0.3 +P > L/home/urnerk/include" > print "Rendering... (this will take some time)" > os.system(linuxcomm+" +I"+filename) > if os.name == 'nt': > wincomm = '"c:\\program files\\POV-Ray for Windows > v3.5\\bin\\pvengine" -V fpp.ini' > print "Rendering... (this will take some time)" > os.system(wincomm) > > Certainly if you're able to frame a shot in Pygeo and then feed it > to a > POV-Ray camera for rendering, that'd be a useful feature (maybe > you have it > already). Users of Springdance certainly appreciate and make good > use of > that feature, and of Struck (which'd export full-fledged > animations, using > POV-Ray's clock-driven looping feature). > > If you've not used Springdance, I recommend adding it to your > interactivegeometry toolkit -- but it only runs in Windows (coded > in Delphi): > http://shapeofspace.org/springdance/ > > > Related blog link: > http://worldgame.blogspot.com/2004/11/canadian-tech-springdance.html > > > Kirby > > > From urnerk at qwest.net Thu Jan 27 22:39:03 2005 From: urnerk at qwest.net (Kirby Urner) Date: Thu Jan 27 22:39:06 2005 Subject: [Edu-sig] Just registered for Pycon 2005 In-Reply-To: <20050125155654.F23011E4002@bag.python.org> Message-ID: <20050127213905.F26321E4003@bag.python.org> Made it under the wire for the early bird special. Haven't tried to book a flight yet. Autobio: I was in DC for Pycon last year. Coincidentally, we had a symposium on Buckminster Fuller in the very same venue. As that was winding down, Pycon was winding up. Seemed so perfect. Then we found out my wife had cancer, and a serious form of it at that. I flew home immediately. Now, a year later, she's doing well, in recovery, so I'm going to try this again. I've never been to a Pycon before. Kirby From ajsiegel at optonline.net Fri Jan 28 04:25:51 2005 From: ajsiegel at optonline.net (Arthur) Date: Fri Jan 28 04:28:14 2005 Subject: [Edu-sig] Naming in Python Message-ID: <0IB0003WFCAQV5@mta3.srv.hcvlny.cv.net> Any opinions as to whether the following is an insight, or the kind of pseudo-incite I tend to realize I have had when I sober up in the morning? That the "readability" of Python is built-in to the structure of the language in a largely non-obvious way, and has little to do with white space significance, surface level syntax, etc. Python is a "naming" language. The interpreter is working with assigned names of objects more directly and more significantly than in other languages (of which I am aware). As a programmer, one is conversing with the interpreter by way of these names, as names and objects are closely bound. And it therefore seems intuitively sensible to make names significant, because in fact they are significant at a low and technical level. As opposed to C, for example. Which sort of laughs of you for going to the trouble for adding extra keystrokes to placeholders. Or something along these lines. Art From ajsiegel at optonline.net Sat Jan 29 15:29:16 2005 From: ajsiegel at optonline.net (Arthur) Date: Sat Jan 29 15:31:28 2005 Subject: [Edu-sig] re: Naming in Python Message-ID: <0IB300C1E1OD1M@mta8.srv.hcvlny.cv.net> I wrote - >Any opinions as to whether the following is an insight, or the kind of >pseudo-incite I tend to realize I have had when I sober up in the morning? >That the "readability" of Python is built-in to the structure of the >language in a largely non-obvious way, and has little to do with white >space significance, surface level syntax, etc. >Python is a "naming" language. The interpreter is working with assigned >names of objects more directly and more significantly than in other >languages (of which I am aware). As a programmer, one is conversing with >the interpreter by way of these names, as names and objects are closely >bound. And it therefore seems intuitively sensible to make names >significant, because in fact they are significant at a low and technical >level. >As opposed to C, for example. Which sort of laughs of you for going to the >trouble for adding extra keystrokes to placeholders. >Or something along these lines. I'll sink to commenting on my own post. Not the first time. Sobering up - I still think the observation has real substance. Though it is only an insight to the extent that it is non-obvious. I guess that depends on who you are and where you are coming from. It took me a while to get here. Art From ajsiegel at optonline.net Sat Jan 29 16:25:29 2005 From: ajsiegel at optonline.net (Arthur) Date: Sat Jan 29 16:27:37 2005 Subject: [Edu-sig] re: Naming in Python In-Reply-To: <0IB300C1E1OD1M@mta8.srv.hcvlny.cv.net> Message-ID: <0IB3006F649ZDZ@mta4.srv.hcvlny.cv.net> > I'll sink to commenting on my own post. Not the first time. > > Sobering up - I still think the observation has real substance. > > Though it is only an insight to the extent that it is non-obvious. I > guess > that depends on who you are and where you are coming from. > > It took me a while to get here. > > Art Guido once scolded me by suggesting I set up a blog rather than "bothering" people on public forums. I have concluded that Guido is never *completely* wrong,,,;) It seems to me that the reason that decorators are/were so controversial - why so many people find them unPythonic - is that they violate the principle I am trying to get my hands on here. As it happens, given that decorators were to be, I supported Guido's choice of syntax - feeling it effectively communicated that we were dealing with the exception to the rule. I don't know the extent to which Guido's decision there was intuitive, or if consciously anywhere along the lines that I am suggesting. Art From urnerk at qwest.net Sat Jan 29 17:18:05 2005 From: urnerk at qwest.net (Kirby Urner) Date: Sat Jan 29 17:20:10 2005 Subject: [Edu-sig] re: Naming in Python In-Reply-To: <0IB3006F649ZDZ@mta4.srv.hcvlny.cv.net> Message-ID: <20050129162008.DC9DF1E4004@bag.python.org> Hi Art -- I've been thinking about your observation, but haven't come up with a really coherent way to extend your thinking, in such a way that a prove I know what you mean. Per Wittgenstein (a philosopher I like, and his philo the focus another eGroup I post in), if you go 1, 12, 42 and I go 92, 162, that sort of proves I have an idea about the rule you're using (or maybe not?). In Pythonic terms, you've written a generator, and I've reverse engineered it, so now we're able to compare iterable.next() outputs, to see if we get the same answers. What I'm thinking sort of in parallel, divergently or convergently I don't know yet, is that Python gets us away from any strict notion of "primitives." In other languages, lip service may be paid to "everything is an object" but when you get right down to it, you need syntactical tricks to make that a reality. In C# you can "box" an integer, to treat it like a class object, and in Java I guess you grab an instance of Integer or something. But in neither language can you do what you can in Python: enter dir(2) in the shell and get a dump of everything 1 "knows how to do" (something I show the first day in my Python classes; I call it "making 2 spill its guts" (OK, these are high schoolers, still somewhat in to grossology)). As for decorators, at the moment I'm having no problems with the new syntax. You may have seen that post on the calculus. I was gratified to discover that @ may be used to hand off the function that follows to a class (to some __init__ method), so long as what's returned is likewise a function. Wait, is that what I did? No, not exactly. I fed the function to class and thereby get back an *object*, but this object was *callable*, and that's enough to make its behavior *like* a function's. So everything worked. Cool. Here's the code again, which automatically lists 3rd degree polynomial outputs *and* its 2nd degree derivative: #==== class Function: def __init__(self, f): self.f = lambda x: f(x) def __add__(self, other): return Function(lambda x: self.f(x) + other.f(x)) def __sub__(self,other): return Function(lambda x: self.f(x) - other.f(x)) def __mul__(self,other): return Function(lambda x: self.f(x) * other.f(x)) def __div__(self,other): return Function(lambda x: self.f(x) / other.f(x)) def __call__(self,x): """call wrapped function with argument x, return result""" return self.f(x) class Pair: def __init__(self, u, du): self.u = u self.du = du def __add__(self, other): return Pair(self.u + other.u, self.du + other.du) def __sub__(self, other): return Pair(self.u - other.u, self.du - other.du) def __mul__(self, other): return Pair(self.u * other.u, \ self.du * other.u + self.u * other.du) def __div__(self, other): return Pair(self.u/other.u, \ (self.du * other.u - self.u * other.du)/other.u**2) @Function def ident(x): return x @Function def one(x): return 1 p1 = Pair(ident, one) newp = p1 * p1 * p1 print [newp.u(i) for i in range(-5,6)] print [newp.du(i) for i in range(-5,6)] #==== Kirby From baumanpdx at comcast.net Sat Jan 29 19:25:48 2005 From: baumanpdx at comcast.net (The Bauman Family) Date: Sat Jan 29 19:25:56 2005 Subject: [Edu-sig] re: Naming in Python In-Reply-To: <20050129162008.DC9DF1E4004@bag.python.org> References: <20050129162008.DC9DF1E4004@bag.python.org> Message-ID: <41FBD52C.30703@comcast.net> Kirby Urner wrote: > As for decorators, at the moment I'm having no problems with the new > syntax. > You may have seen that post on the calculus. I was gratified to discover > that @ may be used to hand off the function that follows to a class > (to some > __init__ method), so long as what's returned is likewise a function. > Wait, > is that what I did? No, not exactly. I fed the function to class and > thereby get back an *object*, but this object was *callable*, and that's > enough to make its behavior *like* a function's. So everything worked. > Cool. > > Although everybody already knows this, I'm sure, a function actually is a class, so technically it is a function if you have all the things you get if you dir() a function. The only weird part here is that there's an endless number of functions (actually methods, which are treated exactly the same as functions for our purposes) inside these classes, like __repr__, so you can do: >>> def afunction(): return 0 >>> afunction() 0 >>> dir(afunction) ['__call__', '__class__', '__delattr__', '__dict__', '__doc__', '__get__', '__getattribute__', '__hash__', '__init__', '__module__', '__name__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__', 'func_closure', 'func_code', 'func_defaults', 'func_dict', 'func_doc', 'func_globals', 'func_name'] >>> dir(afunction.__repr__) ['__call__', '__class__', '__delattr__', '__doc__', '__getattribute__', '__hash__', '__init__', '__name__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__'] >>> dir(afunction.__repr__.__repr__) ['__call__', '__class__', '__delattr__', '__doc__', '__getattribute__', '__hash__', '__init__', '__name__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__'] >>> dir(afunction.__repr__.__repr__.__repr__) ['__call__', '__class__', '__delattr__', '__doc__', '__getattribute__', '__hash__', '__init__', '__name__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__'] >>> dir(afunction.__repr__.__repr__.__repr__.__repr__) ['__call__', '__class__', '__delattr__', '__doc__', '__getattribute__', '__hash__', '__init__', '__name__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__'] >>> afunction.__repr__.__repr__.__repr__.__repr__() '' I wonder how Python deals with this endless chain of __repr__'s. Maybe a function's attributes are generated on use, in which case they /aren't/ really an object at all, just a data type that looks like an object and acts like an object. I've never looked at any code having to do with Python in C or C++, so I wouldn't know. One thing that would be very useful in the next version of Python (regarding decorators) would be the ability to use @return or maybe @print (although I can't think of a use for @print); the ability to put statements (I think that's what they are called) as decorators. Tim -- Visit my website: (and please be a supporter of ... free software, ... free dom, ... by giving others the url) http://kmg.is-a-geek.org Garunteed to be down at least 5% of the time. stff rmed4ur bndwdth "Do you want to reconsider your answer?" "No, I'll remain disconnected." From rsenra at acm.org Sat Jan 29 20:11:53 2005 From: rsenra at acm.org (Rodrigo Dias Arruda Senra) Date: Sat Jan 29 20:12:43 2005 Subject: [Edu-sig] re: Naming in Python In-Reply-To: <41FBD52C.30703@comcast.net> References: <20050129162008.DC9DF1E4004@bag.python.org> <41FBD52C.30703@comcast.net> Message-ID: <20050129171153.64aa620a@Goku> [ The Bauman Family ] ----------------------------------------------- | Although everybody already knows this, I'm sure, a function actually is | a class, Hi Tim, I beg to differ with your statement above. A function is not a class. To prove this point follows: >>> def m(x): pass >>> class M(object): pass >>> type(m) >>> type(M) >>> Altough they have similarities. To illustrate the most obvious one: >>> callable(m) True >>> callable(M) True | so technically it is a function if you have all the things you | get if you dir() a function. Perhaps this is a duck typing style of defining what an object *is*. But a function is (OO framework sense) definetely an object: >>> isinstance(m,object) True Therefore, a function supports the object protocol: >>> x = object() >>> dir(x) ['__class__', '__delattr__', '__doc__', '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__'] | >>> afunction.__repr__.__repr__.__repr__.__repr__() | '' | | I wonder how Python deals with this endless chain of __repr__'s. >>> m This is the function object. >>> m.__repr__() '' This is the execution of method __repr__() bound to the function object m >>> m.__repr__ m.__repr__ is an object (a method-wrapper) representing the method called above. >>> m.__repr__.__repr__ Every object supports __repr__, even method-wrapper objects. HTH, best regards, Rod Senra -- ,_ | ) Rodrigo Senra |(______ ----------------------------------------------- _( (|__|] GPr Sistemas http://www.gpr.com.br _ | (|___|] IC - Unicamp http://www.ic.unicamp.br/~921234 ___ (|__|] L___(|_|] ----------------------------------------------- From baumanpdx at comcast.net Sat Jan 29 20:43:12 2005 From: baumanpdx at comcast.net (The Bauman Family) Date: Sat Jan 29 20:43:19 2005 Subject: [Edu-sig] re: Naming in Python In-Reply-To: <20050129171153.64aa620a@Goku> References: <20050129162008.DC9DF1E4004@bag.python.org> <41FBD52C.30703@comcast.net> <20050129171153.64aa620a@Goku> Message-ID: <41FBE750.2020108@comcast.net> Rodrigo Dias Arruda Senra wrote: > [ The Bauman Family ] > ----------------------------------------------- > | Although everybody already knows this, I'm sure, a function actually is > | a class, > > Hi Tim, > I beg to differ with your statement above. A function is not a class. > > Maybe I meant to say object... It is, at least, an object that looks like an object but is not an object. Tim -- Visit my website: (and please be a supporter of ... free software, ... free dom, ... by giving others the url) http://kmg.is-a-geek.org Garunteed to be down at least 5% of the time. stff rmed4ur bndwdth "Do you want to reconsider your answer?" "No, I'll remain disconnected." From ajsiegel at optonline.net Sat Jan 29 20:55:36 2005 From: ajsiegel at optonline.net (ajsiegel@optonline.net) Date: Sat Jan 29 20:55:38 2005 Subject: [Edu-sig] re: Naming in Python Message-ID: <1574b37156fe55.156fe551574b37@optonline.net> ----- Original Message ----- From: Rodrigo Dias Arruda Senra Date: Saturday, January 29, 2005 2:11 pm Subject: Re: [Edu-sig] re: Naming in Python > Perhaps this is a duck typing style of defining what > an object *is*. Interesting that the discussion here led to duck typing, because I was about to use the term myself to explain myself re: naming more generally. Python is happy to oblige us with for thing in things: thing.quack() as long as the things all have a method named "quack", and not caring what each thing is and what quack does in context for any particular thing. ...this being one way in which what I name something is to the essence of my code and why I am inclined to pay attention to names. And while I'm paying attention to names in this way anyway, I am inclined to be sensible in choosing them. Not pinned down, but something along these lines is my point. Happens, BTW, that I was accused on python list of not understanding Python because I don't understand duck typing. My response was something to the effect that it is easier for me to understand how Python works, and if that is called duck typing, I'm OK with that. Trying to understand what duck typing is, as a means to understanding how Python works, is - at least in terms of how my mind works - the wrong way around. Art . From rsenra at acm.org Sat Jan 29 21:05:02 2005 From: rsenra at acm.org (Rodrigo Dias Arruda Senra) Date: Sat Jan 29 21:05:52 2005 Subject: [Edu-sig] re: Naming in Python In-Reply-To: <1574b37156fe55.156fe551574b37@optonline.net> References: <1574b37156fe55.156fe551574b37@optonline.net> Message-ID: <20050129180502.7b29f82b@Goku> [ ajsiegel@optonline.net ] ----------------------------------------------- | as long as the things all have a method named "quack", and not | caring what each thing is and what quack does in context for | any particular thing. | Happens, BTW, that I was accused on python list of not understanding Python | because I don't understand duck typing. I did not follow such discussion, but I believe you were wrongfully accused ;o) Unless you came up with such brief-but-accurate definiton after the discussion. regards, Senra -- ,_ | ) Rodrigo Senra |(______ ----------------------------------------------- _( (|__|] GPr Sistemas http://www.gpr.com.br _ | (|___|] IC - Unicamp http://www.ic.unicamp.br/~921234 ___ (|__|] L___(|_|] ----------------------------------------------- From ajsiegel at optonline.net Sat Jan 29 21:11:58 2005 From: ajsiegel at optonline.net (ajsiegel@optonline.net) Date: Sat Jan 29 21:12:00 2005 Subject: [Edu-sig] re: Naming in Python Message-ID: <14469eb144b0a9.144b0a914469eb@optonline.net> ----- Original Message ----- From: ajsiegel@optonline.net Date: Saturday, January 29, 2005 2:55 pm Subject: Re: [Edu-sig] re: Naming in Python > > as long as the things all have a method named "quack", and not > caring what each thing is and what quack does in context for > any particular thing. > > ...this being one way in which what I name something is to the essence > of my code and why I am inclined to pay attention to names. And while > I'm paying attention to names in this way anyway, I am inclined to > be > sensible in choosing them. And far be it from me to steer clear of a controversy: The convention in VB is, I believe, to name according to type: dblNumber, for example. which would be some evidence that type and naming are intuitatively related, and perhaps gives us some additional clue as to why the issue of typing raises such hackles, and carries such a sense of tinkering with Python at its distinctive core. Art From christian.mascher at gmx.de Sat Jan 29 21:58:21 2005 From: christian.mascher at gmx.de (Christian Mascher) Date: Sat Jan 29 22:04:01 2005 Subject: [Edu-sig] Naming in Python In-Reply-To: <20050128110003.C94191E400E@bag.python.org> References: <20050128110003.C94191E400E@bag.python.org> Message-ID: <41FBF8ED.3040005@gmx.de> Arthur wrote: > Python is a "naming" language. The interpreter is working with assigned > names of objects more directly and more significantly than in other > languages (of which I am aware). I can imagine of one, see below. > As a programmer, one is conversing with the > interpreter by way of these names, as names and objects are closely bound. You mention two special features: 1. Every "variable" is _always_ just a pointer/reference to an individual object. So most of the time you don't even have to think of this level of indirection. And you can assign just about anything to a name. 2. "Live objects" can be examined on the spot in the interpreter. You don't have this in compiled languages. Interestingly instructors in Java seem to like this feature , too. When the language doesn't provide for it, you need an intermediate (interpreter-like) program to simulate the experience. Take the BlueJ-environment, where you can manipulate objects in a comparable way (or even through uml-editors and such). Still, this is not only a feature of the language as such, but also of the "environment" or the tools you use together with the language. It's not being interpreted alone, it's the IDLE-shell (rather than the simple command-line), the dir() function, the always accessible module code, documentation close to the source and the flexibility in assigning names whenever you want to. I have found one language which is very similar to Python in respect to the two mentioned characteristics and that is Smalltalk. The variable-concept (everything is an object, every variable a pointer), and the "live environment"-approach to programming are both going back at least as far as Smalltalk-80. (Didn't Guido mention Smalltalk as one of his influences somewhere?) I think both languages "feel" very similar in this way. You can interact with live objects, change them in small steps, examine them (e.g. dir() in Python, inspect in Smalltalk). Programming is fun in both cases. Who needs .exe-files really? Christian From urnerk at qwest.net Sun Jan 30 08:09:53 2005 From: urnerk at qwest.net (Kirby Urner) Date: Sun Jan 30 08:36:37 2005 Subject: [Edu-sig] python satacad: class 3 In-Reply-To: <20050123054849.7D06A1E4002@bag.python.org> Message-ID: <20050130073636.21CC51E4004@bag.python.org> OK, regarding my 3rd class in this Saturday Academy thread, I'm gonna be lazy, sort of, and paste something from another list (with a closed archive, which is why I'm not *just* putting a link). http://groups.yahoo.com/group/math-learn/message/7177 Note this is a *math* class (per catalog description), not just a class about learning to program, so a lot of what follows is very mathematical in nature. It also has the usual conversational layering. I'm following up on a post of my own, so zero and one pointer (>) is me, whereas two pointers (>>) is someone else. =============== From: "Kirby Urner" Date: Sat Jan 29, 2005 8:57 pm Subject: Re: Inching along --- In math-learn@yahoogroups.com, "Kirby Urner" wrote: > > --- In math-learn@yahoogroups.com, "Marie Bahlert" > wrote: > > > OK - Uncle!!! > > > > What is 'octet truss' and 'concentric hierarchy'? > > > > I can't shake the feeling that once I do know what they are it > > won't bother that I didn't. > > > > Marie > > Octet truss is a space frame used in architecture (once you know > what to look for, you'll see it everywhere), but is also a spatial > grid, like the XYZ cubes, and corresponds to a sphere-packing > arrangement known as the CCP and/or FCC. That sounds too technical > for middle schoolers of course, but (a) it's easily graspable using > animations or cartoons and (b) there're a lot of fun off-shoots, > e.g. into architecture as a mentioned, where Alexander Graham Bell, > the telephone guy, was one of its chief pioneers (also > crystallography, virology, and polyhedral numbers ala 'The Book of > Numbers' by Conway and Guy). OK, so some hours have passed, and in the meantime I covered a lot of this material in a class for 9th and 10th graders. My room has a ceiling mounted projector, so it was no problem to dial up some of the relevant content e.g. at: http://www.4dsolutions.net/ocn/numeracy0.html we have the triangular numbers, phasing to the tetrahedral numbers, then a discussion of the cuboctahedral and icosahedral numbers (same). The tetrahedral and cuboctahedral packings are both FCC/CCP, so the link to Bell's octet scaffolding was fairly clear. I pulled up my bell.html and pointed out the date: 1907 -- hey, look at that horse and buggy. This stuff is *old*. Plus I had, as manipulatives, a set of properly proportioned polyhedra, ping pong balls, glued in a set of 6-around-1, 3 and 3 (to give the CCP or HCP seeds). Other stuff. Plus we had a Python command line, so we could build on last week's excursion into core Python syntax, and start generating sequences of these figurate numbers. I showed 'em list comprehension syntax. Plus we had Sloane's Encyclopedia of Integer Sequences on the web, giving us an easy way to dial in some of our Python output, and pull up interesting background materials. To take an example: >>> def cubocta(n): ........if n==1: return 1 ........return 10*(n-1)**2 + 2 (the periods shouldn't be there, but I'm trying to foil the Yahoo web interface, which is cavalier with significant whitespace). >>> cubocta(1) 1 >>> cubocta(2) 12 >>> [cubocta(n) for n in range(1,21)] [1, 12, 42, 92, 162, 252, 362, 492, 642, 812, 1002, 1212, 1442, 1692, 1962, 2252, 2562, 2892, 3242, 3612] OK, so let's paste that sequence into the encyclopedia: http://www.research.att.com/~njas/sequences/ And here it is (takes a few seconds); I'm reformatting a bit to accommodate the Yahoo interface: ========================= ID Number: A005901 (Formerly M4834) URL: http://www.research.att.com/projects/OEIS?Anum=A005901 Sequence: 1,12,42,92,162,252,362,492,642,812,1002,1212, 1442,1692,1962,2252,2562,2892,3242,3612,4002,4412,4842, 5292,5762,6252,6762,7292,7842,8412,9002,9612,10242,10892, 11562,12252,12962,13692,14442,15212,16002 Name: Points on surface of cuboctahedron (or icosahedron): a(0) = 1, for n > 0, a(n) = 10n^2 + 2 (coordination sequence for f.c.c. lattice). References H. S. M. Coxeter, ``Polyhedral numbers,'' in R. S. Cohen et al., editors, For Dirk Struik. Reidel, Dordrecht, 1974, pp. 25-35. Gmelin Handbook of Inorg. and Organomet. Chem., 8th Ed., 1994, TYPIX search code (225) cF4 R. W. Marks and R. B. Fuller, The Dymaxion World of Buckminster Fuller. Anchor, NY, 1973, p. 46. S. Rosen, Wizard of the Dome: R. Buckminster Fuller; Designer for the Future. Little, Brown, Boston, 1969, p. 109. B. K. Teo and N. J. A. Sloane, Magic numbers in polygonal and polyhedral clusters, Inorgan. Chem. 24 (1985), 4545-4558. Links: Index entries for sequences related to f.c.c. lattice J. H. Conway and N. J. A. Sloane, Low-Dimensional Lattices VII: Coordination Sequences, Proc. Royal Soc. London, A453 (1997), 2369-2389 (Abstract, pdf, ps). R. W. Grosse-Kunstleve, G. O. Brunner and N. J. A. Sloane, Algebraic Description of Coordination Sequences and Exact Topological Densities for Zeolites, Acta Cryst., A52 (1996), pp. 879-889. R. W. Grosse-Kunstleve, Coordination Sequences and Encyclopedia of Integer Sequences N. J. A. Sloane, A portion of the f.c.c. lattice packing. K. Urner, Microarchitecture of the Virus Program: (PARI) a(n)=if(n<0,0,10*n^2+1+(n>0)) See also: Cf. A004015. Adjacent sequences: A005898 A005899 A005900 this_sequence A005902 A005903 A005904 Sequence in context: A022672 A085798 A045945 this_sequence A090554 A009948 A007586 Keywords: nonn,easy,nice Offset: 0 Author(s): njas, R. Vaughan ========================= Hey, did you catch my name in all that? There's a link to one of my web essays. I'm proud to be in such august company, and as a Princeton philosophy alum at that (philo overlaps with math of course, e.g. I'm pretty up on my Wittgenstein, author of 'Remarks on the Foundations of Mathematics' and related works). > The concentric hierarchy fits into the octet truss, in that each > ball in the CCP may be considered nested inside a space-filling > rhombic dodecahedron of volume 6. I usually plug Kepler at this point. We also got into Euler's Law for Polyhedra (V + F = E + 2), same as I do with the 2nd and 3rd graders. We counted up these topological features and did a chart on the whiteboard -- standard Fuller School content. > Relative to this volume, the octahedral and tetrahedral voids > defined by CCP spheres have volumes 4 and 1 respectively -- nice > whole number volumes (you can get the XYZ cubes into this too, > with volumes 3). Of course in XYZ we want said cubes to have volume 1, not 3, but really, given the face diagonals are 2, we want root(2) to the 3rd power for these volume 3 guys, hence a candidate conversion constant (as between the royal and metric systems) -- not the kind of detail I needed to get into in my class today, but a few words on math-learn can't hurt. > Finally, the cuboctahedron, defined by 12 balls packed around a > nuclear one (the basis of the CCP -- from there you may keep packing > outwardly: 1, 12, 42, 92, 162 balls etc.) Yeah, we just did this. Thanks to the Jitterbug Transformation, we have a way of showing how cuboctahedral and icosahedral shells contain the same number of balls, per aforementioned encyclopedia entry. > has a volume of precisely 20. I show all this by pouring beans > between polyhedral mixing cups; in front of 2nd and 3rd graders (or > pre-school Montessori). > Didn't get to the beans this time. Maybe next week. > You may think this all sounds very college, very liberal arts, and > you'd be right, but we're dropping ladders to middle schoolers, so > they can start climbing past their clueless NCTM teachers. This is > the 21st Century after all. > But you wouldn't know it from randomly dropping in on our nation's math classes. Very 20th Century, or maybe 19th? Hey, did you know that Pascal's Triangle fits in here really well? You've got both the triangular and tetrahedral numbers going down adjacent columns. That's an opportunity to link in some of these combinatorics we've been discussing, ala the bionomial theorem. Cite 'The Book of Numbers' again. Then there's Pascal's Tetrahedron and Half-Octahedron. > Here're a link, apropos the above, to a page about Bell: > http://www.grunch.net/synergetics/bell.html > > Kirby > > PS: I'll actually be going over much of this material with 9th and > 10th graders later today, in the course of an extracurricular > enrichment class that's also heavy into programming. I have a > whole box of manipulatives, and plenty of graphics (included > animated ones) to project off the web, so I don't expect them to > be unclear about any of this, a few short hours from now. Well, I've showed you some of the web pages I projected (did you catch that animated GIF of the growing FCC lattice -- I hope your web browser hasn't been crippled to block GIF animations). But what about my manipulatives, I haven't shown you those. What I'll do right now, is go to my living room, spread my manipulatives out on the floor, and take a digital picture. I might get my dog in it too. I'll upload the photo to the Photos section, and those of you who know how to navigate the Yahoo interface can check it out! << pause while I do said activity >> << tarnation! this FujiFilm FinePix 2600 has been going down hill for awhile, battery door held on with tape, but tonight she appears to have lost all utility -- I'll need to rescue that SmartCard as it has lots of good pix of Julian's sculptures at Gallery 500. Oh well, some other time then -- I'll let ya'll know >> > And yet, back at their high schools, their teachers'll likely just > give 'em blank stares if they try to talk up any of what I'm > showing 'em. > That's why we're looking to TV: it's too late to keep worrying > about the teachers at this point, plus they've had over 30 years to > catch up on this stuff. Yep, lots of TV queuing up. We'll be encouraging students to stay home and get an education, or maybe go to school and use the same projector we use for the web, to screen vid clips. Kids'll help make these clips too, cuz in the 21st Century, it's part of basic literacy to know how to make video (storyboarding, editing and like that). Speaking of which, I also showed 'em a 24 minute video made with student assistance at Yorktown High in Virginia. It's a pro-Python propaganda piece: a lot of talking heads interspersed in a hokey love story about this boy geek with a crush on a girl geek. She knows Python, he's just learning. She learned it from her dad, a 60s hippie (now oldster) who calls it his "secret weapon" (check it out!). http://www.ibiblio.org/obp/pyBiblio/pythonvideo.php (big file, you need bandwidth). The rest of my day I spent doing pro database work for a client in Hillsboro, not far from OGI. But that's another story for another list. Kirby Instructor Saturday Academy Portland State University Oregon =============== From ajsiegel at optonline.net Sun Jan 30 12:15:55 2005 From: ajsiegel at optonline.net (Arthur) Date: Sun Jan 30 12:18:07 2005 Subject: [Edu-sig] re: Naming in Python In-Reply-To: <0IB300H056PJ91@mta21.srv.hcvlny.cv.net> Message-ID: <0IB400EVHNE4SZ@mta3.srv.hcvlny.cv.net> > -----Original Message----- > From: Kirby Urner [mailto:urnerk@qwest.net] > Sent: Saturday, January 29, 2005 11:18 AM > To: 'Arthur'; edu-sig@python.org > Subject: RE: [Edu-sig] re: Naming in Python > > > Hi Art -- > > I've been thinking about your observation, but haven't come up with a > really > coherent way to extend your thinking, in such a way that a prove I know > what > you mean. Per Wittgenstein (a philosopher I like, and his philo the focus > another eGroup I post in), if you go 1, 12, 42 and I go 92, 162, that > sort > of proves I have an idea about the rule you're using (or maybe not?). Wittgenstein, huh? In an introduction to one of Wittgenstein's books, Bertrand Russell notes the influence of projective geometry on Wittgenstein - saying something to the effect that Wittgenstein applied projective geometry concepts to linguistics. Getting past Russell's introduction and into Wittgenstein writing itself, I pretty much get nowhere. It is a case where I would need to be taught - get some guidance from someone who has broken through. Or perhaps I don't have the background in philosophical ideas and history, to understand the context of Wittgenstein's thought. Maybe a break-out session on Wittgenstein at PyCon ;) Art From urnerk at qwest.net Sun Jan 30 17:21:20 2005 From: urnerk at qwest.net (Kirby Urner) Date: Sun Jan 30 17:21:24 2005 Subject: [Edu-sig] re: Naming in Python In-Reply-To: <0IB400EVHNE4SZ@mta3.srv.hcvlny.cv.net> Message-ID: <20050130162121.EC7CE1E4004@bag.python.org> > Maybe a break-out session on Wittgenstein at PyCon ;) > > Art Well, at least you and I should talk, maybe over a beer. You should be aware that Wittgenstein came up with two different philosophies in his career. They're linked, but the 2nd is a radical departure, which Russell couldn't fathom. The 2nd is also a lot easier to read than the 1st, even if its point may seem elusive. Kirby From ajsiegel at optonline.net Sun Jan 30 18:25:35 2005 From: ajsiegel at optonline.net (Arthur) Date: Sun Jan 30 18:28:07 2005 Subject: [Edu-sig] re: Naming in Python In-Reply-To: <0IB5001ND1FK23@mta25.srv.hcvlny.cv.net> Message-ID: <0IB5006E64I870@mta3.srv.hcvlny.cv.net> > -----Original Message----- > From: Kirby Urner [mailto:urnerk@qwest.net] > > > Maybe a break-out session on Wittgenstein at PyCon ;) > > > > Art > > Well, at least you and I should talk, maybe over a beer. Beer. I'll have to try to remember my ID ;) Look forward to it. Art From ggbaker at cs.sfu.ca Mon Jan 31 23:26:16 2005 From: ggbaker at cs.sfu.ca (Greg Baker) Date: Mon Jan 31 23:26:20 2005 Subject: [Edu-sig] IDLE refusing to run In-Reply-To: <1106340864.1325.15.camel@lefty> References: <1106340864.1325.15.camel@lefty> Message-ID: <1107210376.3701.16.camel@lefty> Just a followup on this... I managed to get a student to work through it with me. The problem was with the IDLE shortcut on the desktop & start menu. When she manually dug through directories and opened idle.pyw, it worked fine. Of course, once it worked, she didn't try uninstalling and reinstalling to see if that fixed it. On Fri, 2005-01-21 at 12:54 -0800, Greg Baker wrote: > We have had complaints from a few students running Python under Windows > that they can't get things running. All seem to take the form: > 1. At some point, Python/IDLE under Windows crashed. > 2. IDLE won't run at all after that. > 3. The regular interpreter will run (python.exe). > 4. Uninstalling/reinstalling doesn't help. > > Does anybody have any idea what to do about this? (Or who to ask?) I > haven't been able to reproduce it to test, but it has happened to > several students independantly. > -- Greg Baker, Lecturer School of Computing Science Simon Fraser University Burnaby, BC, V5A 1S6 E-mail: ggbaker@cs.sfu.ca