From urnerk@qwest.net Tue Jul 1 02:06:22 2003 From: urnerk@qwest.net (Kirby Urner) Date: Mon, 30 Jun 2003 18:06:22 -0700 Subject: [Edu-sig] re: Terminology question: just operator overriding? In-Reply-To: <000801c33f39$c719abe0$0c02a8c0@Arts> References: <5.2.0.9.0.20030629233248.02494580@pop.ptld.qwest.net> <5.2.0.9.0.20030629134106.01f95f88@pop.ptld.qwest.net> <5.2.0.9.0.20030629134106.01f95f88@pop.ptld.qwest.net> <5.2.0.9.0.20030629233248.02494580@pop.ptld.qwest.net> <5.2.0.9.0.20030630094929.019d2760@pop.ptld.qwest.net> Message-ID: <5.2.0.9.0.20030630173702.01b22178@pop.ptld.qwest.net> At 02:59 PM 6/30/2003 -0400, Arthur wrote: >Kirby writes - > > > Agreed. It's one thing to be a useful paradigm, another thing to claim > > to be THE paradigm. No need to get too doctrinaire. > >In fairness to Python, perhaps you should at least give some play to its >multi-paradigm approach. Just so people don't confuse it with being >religiously OO, as for example, Ruby or Smalltalk seem to be. Talking Also Java. I understand that in Perl the class definition is really synonymous with the module defining it. In Python, a module as similar to a class, in that we use dot notation to access its contents. There's a dictionary involved. But there's no subclassing of modules. >through my hat, BTW, if it isn't clear - that is, considering the depth of >my undersanding of these issues and my experience with Smalltalk and Ruby. In Smalltalk, as I understand it, there's no direct access to any of what we'd call a property. The interface of an object to the outer world is methods and that's it. I've started through the Ruby tutorial a few times. I'm sort of like Eckel here -- it's not enough better/different from Python to attract really sustained interest, whereas a language as different as J... Bruce hadn't heard of J when I mentioned it during his presentation to PORPIG. >The fact is that since Python is my major language, the distinction between >programming paradigms is not a very useful paradigm with which to concern >onceself. The best way to get from Point A to Point B, via Python's >facilities, is the more useful question. What paradigm borders I cross in >the process is not something with which I concern myself (or truly >understand). If I had more trouble finding my way from A to B - in a way >that someone following after me would have difficulty following - I would >then concern myself more with why that might be. And think more, perhaps, >about programming paradigms. At the level at which I am working, at least, I >don't see the issue arising. Makes sense. What I like about Python is how easy it makes the class idea. You don't need to consider it an advanced topic. You can define functions in the usual fashion, and interact with them in the shell. Then, if you like, you can bundle them such that they're presented through a class. For example, one kind of math object I *do* get into in my OSCON slides is the permutation. A permutation is a mapping of elements to the same elements in a different order (surjective and onto, as the math heads like to say). Take a deck of cards... Anyway, there's a meaning for multiplication here, in that if one permuation takes you from A to B, and another from B to C, then their product takes you directly from A to C. I develop that as a function at the module level, then invoke it internally to a class definition. The pattern is like this: -------- Module ------------- def compose(map1, map2): ... return map3 class Permutation(object): ... def __mul__(self): return Permutation(compose(self.amap, other.amap)) ------------------------------ In other words, the class definition wraps first class functions without bothering to rewrite them. It's because Python allows first class functions, not just classes, that we're able to do this. >My prejudice toward using OOP concepts was probably just a function of the >fact that it was a natural fit for much of what I was doing and how I was >thinking about what I was doing. I'm glad you were in the right frame of mind at the right time. I don't think there's anything quite like PyGeo out there. It's still too new to have imitators. Is it explicitly GPL'd? I don't remember. I think you'd be pleased if some 15 year old started hacking into it, yes? >Parathentically, the difficulty with OOP is spoken about, in things I have >stumbled across, as a Circle and Ellipse problem (I think I have this >right). Being a form of the Chicken and Egg problem. I'm not familiar with this particular critique. So I'll take the bait. Seems the ellipse would be the more general case, with the circle being a special case of ellipse, kind of like the square is a special case of rectangle. In the typical Venn Diagram, the squares go inside the rectangles, so circles should go inside the ellipses. >Interestingly, to me, thinking in terms of Projective Geoemetry, the issue >evaporates. Since they the Circle and Ellipse are projectively equivalent. >And one would not expect to be able to derive one from the other. They are >the same thing, different spelling. > >Art Ah so. So maybe it's not an issue of deciding which inherits from which. There's only one class here. Likewise with the triangle. Can I get any triangle I want from the equilateral, depending on how I project? I'm experiencing an upwelling of ignorance re something so basic, turned spontaneously to Google, only to become side-tracked by http://www.geocities.com/moonhoabinh/chatter.html ... Perhaps you have the time to give us some pointers re triangles in projective geometry. Any PyGeos already done on that topic? Kirby From urnerk@qwest.net Tue Jul 1 06:07:26 2003 From: urnerk@qwest.net (Kirby Urner) Date: Mon, 30 Jun 2003 22:07:26 -0700 Subject: [Edu-sig] re: Terminology question: just operator overriding? In-Reply-To: <5.2.0.9.0.20030630173702.01b22178@pop.ptld.qwest.net> References: <000801c33f39$c719abe0$0c02a8c0@Arts> <5.2.0.9.0.20030629233248.02494580@pop.ptld.qwest.net> <5.2.0.9.0.20030629134106.01f95f88@pop.ptld.qwest.net> <5.2.0.9.0.20030629134106.01f95f88@pop.ptld.qwest.net> <5.2.0.9.0.20030629233248.02494580@pop.ptld.qwest.net> <5.2.0.9.0.20030630094929.019d2760@pop.ptld.qwest.net> Message-ID: <5.2.0.9.0.20030630215651.02169198@pop.ptld.qwest.net> At 06:06 PM 6/30/2003 -0700, Kirby Urner wrote: >The pattern is like this: > >-------- Module ------------- > > def compose(map1, map2): > ... > return map3 > > class Permutation(object): > ... > def __mul__(self): sorry, goofed: def __mul__(self, other): > return Permutation(compose(self.amap, other.amap)) > >------------------------------ >>> p1 = P(simplecode(letters)) # random permuation using A-Z plus space >>> p2 = P(simplecode(letters)) # ditto >>> p1 [['A', 'W', 'Z', 'R', 'N', 'G'], ['C', 'Q', 'S', 'X', ' ', 'B', 'M'], ['E', 'V', 'L'], ['D', 'K', 'J', 'O', 'Y', 'P', 'H', 'T', 'U', 'F', 'I']] Using cyclic notation e.g. A goes to W, W to R and so on. >>> p2 [['A', 'Q', 'T', 'Y', 'P', 'S', 'D', 'K', 'I', 'M', 'U', 'O'], ['C'], ['B'], ['E', 'N', 'G', 'V', 'H', ' ', 'W'], ['F', 'J', 'Z'], ['L', 'R', 'X']] Here W goes to E (wraps around at the end of the cycle). >>> p1 * p2 # operator overloading [['A', 'E', 'H', 'Y', 'S', 'L', 'N', 'V', 'R', 'G', 'Q', 'D', 'I', 'K', 'Z', 'X', 'W', 'F', 'M', 'C', 'T', 'O', 'P', ' ', 'B', 'U', 'J']] So the product takes A straight to E. Interesting that the resulting permutation has the one big cycle. I didn't plan that. >>> encode("THIS IS A MESSAGE ENCODED USING A PERMUTATION",p1.map) 'UTDXBDXBWBCVXXWAVBVGQYKVKBFXDGABWBHVNCFUWUDYG' >>> decode('UTDXBDXBWBCVXXWAVBVGQYKVKBFXDGABWBHVNCFUWUDYG',p1.map) 'THIS IS A MESSAGE ENCODED USING A PERMUTATION' Kirby From urnerk@qwest.net Tue Jul 1 06:14:06 2003 From: urnerk@qwest.net (Kirby Urner) Date: Mon, 30 Jun 2003 22:14:06 -0700 Subject: [Edu-sig] re: Terminology question: just operator overriding? In-Reply-To: <5.2.0.9.0.20030630215651.02169198@pop.ptld.qwest.net> References: <5.2.0.9.0.20030630173702.01b22178@pop.ptld.qwest.net> <000801c33f39$c719abe0$0c02a8c0@Arts> <5.2.0.9.0.20030629233248.02494580@pop.ptld.qwest.net> <5.2.0.9.0.20030629134106.01f95f88@pop.ptld.qwest.net> <5.2.0.9.0.20030629134106.01f95f88@pop.ptld.qwest.net> <5.2.0.9.0.20030629233248.02494580@pop.ptld.qwest.net> <5.2.0.9.0.20030630094929.019d2760@pop.ptld.qwest.net> Message-ID: <5.2.0.9.0.20030630221103.02168610@pop.ptld.qwest.net> At 10:07 PM 6/30/2003 -0700, Kirby Urner wrote: > >>> p1 > [['A', 'W', 'Z', 'R', 'N', 'G'], ['C', 'Q', 'S', 'X', ' ', 'B', 'M'], > ['E', 'V', 'L'], ['D', 'K', 'J', 'O', 'Y', 'P', 'H', 'T', 'U', 'F', 'I']] > >Using cyclic notation e.g. A goes to W, W to R and so on. Goofed again. A to W, W to Z, Z to R and so on (G to A). I use the random.shuffle(list) function to jiggle the letters and make the permutation. def simplecode (elems): neworder = elems[:] # make copy random.shuffle(neworder) return dict( zip(elems, neworder) ) The letters are just: letters = list(string.ascii_uppercase + ' ') Better quit now, before this thread becomes a never ending erratum. Kirby From ajsiegel@optonline.net Tue Jul 1 17:42:25 2003 From: ajsiegel@optonline.net (Arthur) Date: Tue, 01 Jul 2003 12:42:25 -0400 Subject: [Edu-sig] OT Message-ID: <000c01c33fef$c14a46f0$0c02a8c0@Arts> Sorry. You started, by pointing here. At: http://www.geocities.com/moonhoabinh/Unrevolution.html there is discussion about Cabbalistic vs. rabbinatical conflict within the Jewish tradition. Interesting stuff. The problem is, in my view, in taking sides, as it seems to me is done here. The Hasidic movement in Eastern Europe of the 16th century was the most recent mass rebeliion against the rabbinical authority. And was a true burst of creative energy. Shades of San Francisco 1960's and well beyond. Miracles and ecstacies and beautiful stories which are handed down. The descendents of that movement walk around, ridiculously, IMO, in 16th century Polish garb and represent the most repressed and repressive faction among the many factions of Jewish life today. Can't say what the dynaimics are. But I do think there is a kind of dynamics: ecstacy + time = blah, to coin a term. Preferably: One's heart with the Cabbalists, and one's head with the rabbinate. Identifying "America" or the American way of life or Corporations with "evil", as is done rhetorically - again and again - directly and indirectly, has already done much to contribute to the death of innocents. And will never contribute anything more or better than that. Why don't you care? Art From ajsiegel@optonline.net Tue Jul 1 18:18:13 2003 From: ajsiegel@optonline.net (Arthur) Date: Tue, 01 Jul 2003 13:18:13 -0400 Subject: [Edu-sig] Re: OT Message-ID: <001d01c33ff4$c2c77ed0$0c02a8c0@Arts> Boy, was that misdirected. Art ----- Original Message ----- From: "Arthur" To: Sent: Tuesday, July 01, 2003 12:42 PM Subject: OT > Sorry. > > You started, by pointing here. > > At: > > http://www.geocities.com/moonhoabinh/Unrevolution.html > > there is discussion about Cabbalistic vs. rabbinatical conflict within the > Jewish tradition. > > Interesting stuff. > > The problem is, in my view, in taking sides, as it seems to me is done here. > > The Hasidic movement in Eastern Europe of the 16th century was the most > recent mass rebeliion against the rabbinical authority. And was a true burst > of creative energy. Shades of San Francisco 1960's and well beyond. > Miracles and ecstacies and beautiful stories which are handed down. > > The descendents of that movement walk around, ridiculously, IMO, in 16th > century Polish garb and represent the most repressed and repressive faction > among the many factions of Jewish life today. > > Can't say what the dynaimics are. But I do think there is a kind of > dynamics: ecstacy + time = blah, to coin a term. > > Preferably: > One's heart with the Cabbalists, and one's head with the rabbinate. > > Identifying "America" or the American way of life or Corporations with > "evil", as is done rhetorically - again and again - directly and indirectly, > has already done much to contribute to the death of innocents. And will > never contribute anything more or better than that. > > Why don't you care? > > Art > From hancock@anansispaceworks.com Wed Jul 2 00:00:43 2003 From: hancock@anansispaceworks.com (Terry Hancock) Date: Tue, 1 Jul 2003 16:00:43 -0700 Subject: [Edu-sig] Re: OT In-Reply-To: <001d01c33ff4$c2c77ed0$0c02a8c0@Arts> References: <001d01c33ff4$c2c77ed0$0c02a8c0@Arts> Message-ID: On Tuesday 01 July 2003 10:18 am, Arthur wrote: > Boy, was that misdirected. Gosh I'm glad to hear that, I thought you expected an answer from us. :lol: Cheers, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com From ajs@optonline.net Sat Jul 5 14:37:41 2003 From: ajs@optonline.net (Arthur) Date: Sat, 05 Jul 2003 08:37:41 -0500 Subject: [Edu-sig] Learning By Breaking Message-ID: <000801c342fa$9bfea540$1a02a8c0@BasementDell> http://www.artima.com/weblogs/viewpost.jsp?thread=5477 I happen to be a big fan of this technique. Whether I like it or not. """ Learning By Breaking by Barry Warsaw June 24, 2003 Summary One of the best ways to learn how a system works is by breaking it. """ From ajs@optonline.net Sat Jul 5 15:40:43 2003 From: ajs@optonline.net (Arthur) Date: Sat, 05 Jul 2003 09:40:43 -0500 Subject: [Edu-sig] Re: Least used builtins? Message-ID: <001901c34303$6a61e7f0$1a02a8c0@BasementDell> Lulu writes - >Yet a fourth matter is that I think it would be slightly easier to teach >Python to beginners if __builtins__ did not include a number of >functions that were extremely difficult to explain to novices... and >that are really only of use to fairly expert Pythoneers. I find that >callable, classmethod, id, intern, and a number of others fall in this >category. My thinking is that anything meant for experts should need to >get imported by specific request. Python and beginners. As usual where I feel qualified to pop-up with a position. My experience was such that, in retrospect, the only place I feel Python "betrayed" me as someone learning to program with Python and outside of a formal curricula, was in the *absence* of a built-in - "copy". To me, that absence left a conceptual hole in the core (not filled, I contend, by the availability of list[:]). I don't think it is necessary to elaborate in too much detail as to the why the issue is an issue. The full implications of moving something like copy to become a built_in is not something I pretend to have a handle on. As to the limited question, effect on learning (especially self-directed learning) - I believe I have a point. Guido's position seems to be that the presence of copy as a built-in would lead to its overuse by the newbie. My counter-position is that it necessary to understand why one is not using it, and that can only happen if one understand it exists. The thinking along the lines of a more limited set of built_ins might actually serve some resolution of the issue - at least to the extent it is an issue, beyond my own perception of the matter. That is, one will understand sooner that there is functionality conceptually "fundamental", that might not exist in __builtins__. I also happen to agree with the direct point being made. As I happen to be working on a short tutorial for an app, which assumes no prior knowledge of Python. And one the the first things I do - maybe 10 lines into the tutorial - is a dir(__builtins__) from the interactive prompt. Just to give some lay of the land. Three or four years into Python, and I do notice there are a number of items I can't explain to myself, much less to sombody else. And have gotten a fairly long way along writing acutal working apps, with the "more fundamental" subset of __builtins_ which are in common use. This whole area, I think, deserving of attention - especially as I do think something siginificant might be accomplished without really disturbing anything. And perhaps the concept of whittling down the _builtins__, makes more sense than the addition of a new built-in, as I had been advocating. And would accomplish something along the lines that my experience indicates to be advisable - i.e., with respect to "copy" Art From urnerk@qwest.net Sun Jul 6 03:24:45 2003 From: urnerk@qwest.net (urnerk@qwest.net) Date: Sat, 5 Jul 2003 22:24:45 -0400 Subject: [Edu-sig] Re: Least used builtins? Message-ID: <191690-2200370622445807@M2W045.mail2web.com> Just to represent another viewpoint, I'll say that what's in builtins has nothing to do with what does or does not make sense to the beginner=2E It's a set of tools, including some low level ones that only make sense to a non-newbie=2E Likewise, 'copy' isn't there in a generic sense=20 (it's there for dicts, which are builtin and sport a copy method), because= the pro doesn't need it that often=2E What does or doesn't make sense to = the newbie is irrelevant=2E A language need not be designed based on that=20 perspective, to be good=2E It's the job of teachers to smooth the on ramp= , and in that regard, just don't teach all the builtins to start=2E Just=20= because they're all builtins doesn't mean each must be tackled in order, one by one=2E The strikes me as unimaginative, plodding=2E Kirby -------------------------------------------------------------------- mail2web - Check your email from the web at http://mail2web=2Ecom/ =2E From ajs@optonline.net Sun Jul 6 11:29:42 2003 From: ajs@optonline.net (Arthur) Date: Sun, 06 Jul 2003 05:29:42 -0500 Subject: [Edu-sig] Re: Least used builtins? Message-ID: <000601c343a9$83e36e00$1a02a8c0@BasementDell> Kirby writes - >What does or doesn't make sense to the newbie is irrelevant. And an amazing amount of bandwidth has been spent on python-list on the "good for newbies" issue. With much of that discussion inspired, encouraged by Guido. In fact, my position is not far from yours. Other than to say that *since we are arguing the good for newbies issue* anyway - I didn't bring it up - this is my perspective on that issue, based on my own experience. Definitely not arguing it should be, at this stage of Python's development, an overriding design principal. Have argued quite the contrary, in fact. And did so quite against the grain. Where were you then? ;) >It's the job of teachers to smooth the on ramp, and in that regard, just don't teach all the builtins to start >because they're all builtins doesn't mean each must be tackled in order, one by one. Let's not imagine we all have teachers. I understand, and said, that the point I am making is only of real significance for the folks undertaking self-teaching of Python. Which is probably, at this point, about 98% of the people who know it. And most particualrly and significantly for the sub-group who are self-taught, with Python as their first language. If you want, that is my constituency. I am proud to be their self-appointed representative. (You can do that in a land of BDFL's). >The strikes me as unimaginative, plodding. pitooey., Art From ajs@optonline.net Sun Jul 6 11:51:05 2003 From: ajs@optonline.net (Arthur) Date: Sun, 06 Jul 2003 05:51:05 -0500 Subject: [Edu-sig] Re: Least used builtins? Message-ID: <000501c343ac$802ffb90$1a02a8c0@BasementDell> > Kirby writes - > > >What does or doesn't make sense to the newbie is irrelevant. I would, BTW, have very little to say if, for example Guido took that position. Please understand that he has taken the position, here, that the decision about "copy" was made with the newbie in mind. at least in good part. That having it as a built-in would result in its overuse by the newbie. Its the cultural norm to go there in Pythonland. In a recent rehash about case sensitivity, I begged Alex Martelli *not* to go there. And there he went. My comments on "copy" were in response to a point about built-ins and *newbies* being made by Dr. Mertz - one of the more prolific Python authors. I could accuse you of being bullying and politic, for choosing to go after *me* on this issue (rather than Guido or Martelli or Mertz), and in somewhat haughty and nasty terms. But of course I don't want to . Art From ajs@optonline.net Sun Jul 6 12:10:35 2003 From: ajs@optonline.net (Arthur) Date: Sun, 06 Jul 2003 06:10:35 -0500 Subject: [Edu-sig] Re: Least used builtins? Message-ID: <000e01c343af$397347e0$1a02a8c0@BasementDell> I wrote - >> Kirby writes - > >The strikes me as unimaginative, plodding. > > pitooey., To elaborate. I agree that going down the list of built-ins as a teaching technique is unnecessary. My point is much different than that. As always, I am more than willing to have my point rejected - but prefer it happen *after* it is understood. I go on when I feel that it is only a trivialized version of my point that is being put on the dung heap. Deja-vu, again. Art From Jason Cunliffe" Greetings I've been away from Python for while and now diving back, hoping to experiment with Leo and Jabber over the summer... *Context* I am humiliated and feel like moron. I am getting stuck [again] on my most basic eternal Python newbie issue: paths and module import. I must be missing something. I consult some excellent books, then googled further into it, but found I was taken on a pythonesque journey which did not help either. However I met trails of others experiencing similar confusion. I imagine Python teachers and students must have dealt with this satisfactorily gazillion times, but still am compelled to think there must be a better simpler way. I'd really appreciate your help and feedback on my suggestions. Hopefully this will end up as a PEP which makes life easier for all, especially beginners. btw, I tend to agree with Kirby's recent comment: "What does or doesn't make sense to the newbie is irrelevant. A language need not be designed based on that perspective, to be good. It's the job of teachers to smooth the on ramp." But I 'd add to that configuration and preferences *are* the universal 'on-ramp' and need to be designed with beginners in mind as well as advanced professionals. I believe those two goals cannot be satisfied in one simple consistent solution. Python fails at present to achieve this IMHO, [especially for Windows users]. And I sincerely apologize in advance if I've missed the instructions which clearly address these issues. I'll present my problem as narrative based around a set of IDLE sessions. This only very slightly contrived example, and I am not really exaggerating. First Freshly install Python on Win32. Now download and install some modules and packages I want to explore.. Python 2.2.2 (#37, Oct 14 2002, 17:02:34) [MSC 32 bit (Intel)] on win32 Type "copyright", "credits" or "license" for more information. IDLE 0.8 -- press F1 for help PROBLEM #1 Where to install things on Python and how to access them? It seems recommended default is to install modules and packages into Lib/site-packages/some-sub-folder. PROBLEM#2 But what about my personal work? I can find precious little advice on that.. . One of the first things all beginners are taught do is save a "helloworld.py" file. It is good practice for all software to keep user files separate from system or application files. Better for sysadmin, maintenance and collaborative workflow. But, in Python at present the first problem is that creating a personal folder for scripts outside of the application installation which is visible to import statements >>> import jabber Traceback (most recent call last): File "", line 1, in ? import jabber ImportError: No module named jabber >>> hmm.. go study a bit. ok it seems 'jabber' is not yet on the PYTHONPATH. Q: How to see PYTHONPATH? >>> PYTHONPATH Traceback (most recent call last): File "", line 1, in ? PYTHONPATH NameError: name 'PYTHONPATH' is not defined >>> $PYTHONPATH SyntaxError: invalid syntax >>> nope :-(( Since PYTHONPATH is so essential to using Python, surely it would make sense to make that permanently available to people? To my mind an intuitive interface would allow direct typing any of the environment variables in idle shell. Guess it's time to study up some more. Aha! -- sys.path >>> sys.path Traceback (most recent call last): File "", line 1, in ? sys.path NameError: name 'sys' is not defined jeez :-( study up some more >>> import sys >>> sys.path ['C:\\PYTHON22\\Tools\\idle', 'M:\\jasonic\\python', 'C:\\Python22', 'C:\\PYTHON22\\DLLs', 'C:\\PYTHON22\\lib', 'C:\\PYTHON22\\lib\\lib-tk', 'C:\\PYTHON22\\lib\\site-packages'] aah much better.. But still counter-intuitive imho. If "sys.path" is so essential, then why do I have to import sys all the time? And why do so many texts talk about PYTHONPATH when what they really mean is sys.path? And how do I customize my environment so I don't have to jump through these hoops every time? Meanwhile my study has shown I must add jabber to sys.path. ok >>> sys.path.append('C:\\PYTHON22\\lib\\site-packages\\jabber') >>> import jabber >>> jabber >>> Yay! success :-) Now I can follow the jabber examples from my book for a while.... I take a break and shutdown, but when I launch IDLE on my return, trouble in paradise again: >>> import jabber Traceback (most recent call last): File "", line 1, in ? import jabber ImportError: No module named jabber >>> arghh.. ok guess gotta go through all that again [hope I can remember]: >>> sys.path.append('C:\\PYTHON22\\lib\\site-packages\\jabber') >>> import jabber >>> jabber OK yes not such a big deal. But how to add jabber or any module permanently to the path.? I study this but find I am getting more confused... Several options are suggested : a) Run regedit and add jabber to the path entries buried there deep. I don't like this. It feels way too far removed from python. Surely there is some way not to have to mess with regedit.exe? Why isn't there a simple config preferences file I can edit like just about every other software I use? b) edit autoexec.bat and create a PYTHONPATH entry and then add 'jabber' to that. Yikes this seems also too far from python. It uses a syntax I am not certain about. I look in books and google around, but honestly it's hard to find just some simple example I can copy. Autoexec.bat can't even use full pathnames and its is buried like regedit until I learn I can enter 'sysedit' in the Start/Run menu as nice shortcut. Besides, I thought Python was cross-platform and here I am messing with to much windows-specific crap, [ahem] sorry "configuration details". To make matters worse, I learn that apparently Python on windows uses the registry, but IF a PYTHONPATH definition also exists in autoexec.bat, then it will insert those values also so they show up *combined* in Python when I call sys.path yeow :-(( Frankly this seems totally nuts to me. There appears to be no single common place/file where I can keep track of path entries and edit them quickly. Why the hell not? It may not be in essence Python's fault, but surely ther is a better simpler way in 2003? Windows is still the major OS in use globally. Maybe 5-10 years later Linux will be. hmm... I learn from Google search and more book reading that there are some neat ways to customize and streamline Python on my system. c) One advises that I can create a file with .pth suffix. Sounds good, and to be very honest I now remember that eons ago, that is how I did successfully customize my Python installation.Alas I can';t remember and ma having devils own time to track down the crucial steps to do this. Unfortunately hard to find actual any examples on .pth files. Also it too seems to depend upon successful use of PYTHONPATH and I want to get to the heart of the matter. d) I find some references to site.py and something promising called "sitecustomize.py" I try these but no luck. I feel like an idiot and am getting angry and frustrated. I imagine what really would make sense to me and decide to post to Edu-Sig for help. *Dream Solution [DS]* DS #0 -- Display PYTHONPATH when Python boots. Make this a default, which pros can disable via config value. Python 2.2.2 (#37, Oct 14 2002, 17:02:34) [MSC 32 bit (Intel)] on win32 Type "copyright", "credits" or "license" for more information. IDLE 0.8 -- press F1 for help ['C:\\PYTHON22\\Tools\\idle', 'M:\\jasonic\\python', 'C:\\Python22', 'C:\\PYTHON22\\DLLs', 'C:\\PYTHON22\\lib', 'C:\\PYTHON22\\lib\\lib-tk', 'C:\\PYTHON22\\lib\\site-packages'] or like this: Python 2.2.2 (#37, Oct 14 2002, 17:02:34) [MSC 32 bit (Intel)] on win32 Type "copyright", "credits", "license" or "paths" for more information. <<<< What do you think about this ? IDLE 0.8 -- press F1 for help DS #1 -- To be able to enter environment variables directly like this anytime: >>> PYTHONPATH ['C:\\PYTHON22\\Tools\\idle', 'M:\\jasonic\\python', 'C:\\Python22', 'C:\\PYTHON22\\DLLs', 'C:\\PYTHON22\\lib', 'C:\\PYTHON22\\lib\\lib-tk', 'C:\\PYTHON22\\lib\\site-packages'] DS #2 -- To be able to add to that by setting like this: PYTHONPATH = ['C:\\PYTHON22\\Tools\\idle', 'M:\\jasonic\\python', 'C:\\Python22', 'C:\\PYTHON22\\DLLs', 'C:\\PYTHON22\\lib', 'C:\\PYTHON22\\lib\\lib-tk', 'C:\\PYTHON22\\lib\\site-packages', 'C:\\PYTHON22\\lib\\site-packages\\jabber'] <<< the last entry is my addition or by adding or appending: PYTHONPATH.add('C:\\PYTHON22\\lib\\site-packages\\jabber') PYTHONPATH.append('C:\\PYTHON22\\lib\\site-packages\\jabber') You'll may say "Jason, that's not the Python Way to do it. You must be initiated." And I reply, "Ok, but fucking around with autoexec.bat and regedit sure ain't the Python Way either... I've been at this for years, and still tis nuts and that's why I am writing this long edu-sig post. Show me please!" But I concede to learn and follow the sys.path syntax though I still feel very strongly that there *should* also be a more direct aliasing between environment variables outside of Python and how they are called inside Python. Else needs to be much better explained. Just look at most books on Python and you might se what I mean. Most are excellent but I suspect are written by experienced programmers long familiar with handling *nix type environment variables. DS #3 SAVE and LOAD paths Ok this is what I am really proposing: sys.path.save() sys.path.load() These would both default to use a clear single file called "PYTHONPATH.py" created at installation. My point is that people could easily set or get their own and switch on fly like this: sys.path.save('mypathfile.py') sys.path.load('mypathfile.py') where "mypathfile.py" contains a entry such as: PYTHONPATH = ['C:\\PYTHON22\\Tools\\idle', 'M:\\jasonic\\python', 'C:\\Python22', 'C:\\PYTHON22\\DLLs', 'C:\\PYTHON22\\lib', 'C:\\PYTHON22\\lib\\lib-tk', 'C:\\PYTHON22\\lib\\site-packages', 'C:\\PYTHON22\\lib\\site-packages\\jabber'] So in a given session I might do this: >>> sys.path.append('M:\\jasonic\\python') >>> sys.path.save() And I propose the same syntax and approach should work for all the variables in the same way across platforms. All that remains is how best to display or set them all ? I found something which looks close: os.environ["ORACLE_HOME"]="/opt/app/ora/" http://www.faqts.com/knowledge_base/view.phtml/aid/3298/fid/245 I imagine running python and seeing something this Python 2.2.2 (#37, Oct 14 2002, 17:02:34) [MSC 32 bit (Intel)] on win32 Type "copyright", "credits", "license", or "paths" for more information. IDLE 0.8 -- press F1 for help >>> paths PYTHONPATH loaded from ''C:\\python22\PTYHONPATH.py" PYTHONSTARTUP loaded from "M:\\jasonic\\python\\mystartup.py" etc.. Ideally there is a single dict which holds all of these and can be easily viewed and edited anytime on any system the same way and will always be accessible in the Python shell. Perhaps there already is and I'm too dumb to have found it. *Books* Before writing this, last night along with docs and Google research I went to my Python shelf and pulled down the following: - Python Essential Reference by David M. Beazley - The Quick Python Book by Darryl Harms and Kenneth Mcdonald - Python Programming on Win32 by Mark Hammond and Andy Robinson - Core Python Programming by Wesley Chun - Python Cookbook edited by Alex Martelli and David Ascher - Python In A Nutshell by Alex Martelli *Personal* I realize that my main problem is I have a bad memory, especially for things which are counter-intuitive to me. Typically caused by switching between many different systems or like now when I am not daily working with it. I recognize this as a weakness. But also on occasion it is a strength, because motivates to find a better/simpler design. thanks for any help Jason ______________________________________________ Jason Cunliffe [NOMADICS: Director art+design] Tel/fax: +1 718 422-1078 jasonic@nomadics.org N 43:00.000' W 074:31.875' ALT:1144 ft 84 Henry Street #3C Brooklyn NY 11201 USA http://tranzilla.net/.v From Jason Cunliffe" oops -- "I believe those two goals cannot be satisfied in one simple consistent solution." Please read that as "CAN satisfied in one simple consistent solution." sorry, Jason From urnerk@qwest.net Sun Jul 6 20:13:52 2003 From: urnerk@qwest.net (urnerk@qwest.net) Date: Sun, 6 Jul 2003 15:13:52 -0400 Subject: [Edu-sig] Re: Least used builtins? Message-ID: <29950-22003706191352212@M2W033.mail2web.com> >Have argued quite the contrary, in fact=2E And did so quite against the >grain=2E > >Where were you then? ;) Well, I didn't think the new division model needed to have anything to do with newbies either=2E Just so happens that sometimes these=20 issues overlap=2E But there are layers to Python=2E IDLE and other such may well have=20 features that make the language more accessible=2E Prompts, tips, etc=2E = etc=2E There's a difference between the formal language, and the shell/editor combo=2E Question: is there a way to get IDLE or PyCrust or another shell to be both BIG FONT *and* BOLD? Thinking of projecting=2E I can make IDLE shel= l fonts as big as I like, but don't know how to bold 'em=2E > Let's not imagine we all have teachers=2E I understand, and said, that = the > point I am making is only of real significance for the folks undertaking= > self-teaching of Python=2E Which is probably, at this point, about 98% = of > the people who know it=2E Most get at least a little guidance from books and the community, on-line tutorials and such=2E At least that was my own experience=20 (I've certainly never had a formal class in it)=2E >>The strikes me as unimaginative, plodding=2E > >pitooey=2E, Not understanding what you're pitooeying=2E I'm just saying one needn't take a linear path as in "OK, today I'm going to master all the builtins"=2E= Look at some now, come back to others later=2E Kirby PS: since 2=2E1 or so, an alternative to: newlist =3D oldlist[:]=20 is=20 newlist =3D [i for i in oldlist] i=2Ee=2E this is another idiom for copying a list (dunno about relative sp= eed, often won't matter)=2E -------------------------------------------------------------------- mail2web - Check your email from the web at http://mail2web=2Ecom/ =2E From urnerk@qwest.net Sun Jul 6 20:18:01 2003 From: urnerk@qwest.net (urnerk@qwest.net) Date: Sun, 6 Jul 2003 15:18:01 -0400 Subject: [Edu-sig] Re: Least used builtins? Message-ID: <54360-2200370619181248@M2W078.mail2web.com> > Do you agree, or am I overreacting (I know I have my buttons for > Arthur's style)? I disagree=2E He brings strong views and a perspective, but not at the expense of anyone else=2E There's plenty of unused bandwidth on edu-sig IMO=2E =20 But then, I post a lot about a lot of the same things that concern me=20 too, so perhaps I'm also feeling defensive ("first they came for=20 Arthur, and I did nothing, because I wasn't Arthur, then=2E=2E=2E etc=2E) = :-)=2E Kirby -------------------------------------------------------------------- mail2web - Check your email from the web at http://mail2web=2Ecom/ =2E From Jason Cunliffe" Message-ID: <004101c343f5$cf17d540$6401a8c0@ValuedSonyCustomer> Kirby >> Question: is there a way to get IDLE or PyCrust or another shell to be both BIG FONT *and* BOLD? Thinking of projecting. I can make IDLE shell fonts as big as I like, but don't know how to bold 'em. I seem to remember discussion about this here quite some time ago. In fact I was asking the same. As I recall Scintilla has some easy text zooming and style control suitable for projection, video etc. And Pythonwin uses scintilla. But I've not been using PythonWin so I can't test right now. [Got confused last time I tried to install it] Jason From ajs@optonline.net Sun Jul 6 23:06:47 2003 From: ajs@optonline.net (Arthur) Date: Sun, 06 Jul 2003 17:06:47 -0500 Subject: [Edu-sig] Re: Least used builtins? Message-ID: <000501c3440a$e5799ca0$1a02a8c0@BasementDell> >But then, I post a lot about a lot of the same things that concern me >too, so perhaps I'm also feeling defensive ("first they came for >Arthur, and I did nothing, because I wasn't Arthur, then :-) I appreciate the sentiment. But I am not sure there is anything to be done. since I believe what I am up against here is of Cosmic proportion. 1962, Camp Timberlake, Phoenica, New York Bunk 6. He who hit the ball the farthest and ran the fastest knew all. I knew all. Morris Getzels was extremely smart. But he couldn't hit, worth a lick. And therefore knew nothing. So we made his life miserable. I believe my relationship to the Python community is tainted by Karma. I believe, its Morris Getzels' revenge. Art From ajs@optonline.net Mon Jul 7 00:30:07 2003 From: ajs@optonline.net (Arthur) Date: Sun, 06 Jul 2003 18:30:07 -0500 Subject: [Edu-sig] PEPTALK: path sanity and newbie mental Message-ID: <000c01c34416$89bc3c90$1a02a8c0@BasementDell> Jason writes - >I am humiliated and feel like moron. I am getting stuck >[again] on my most basic eternal Python newbie issue: >paths and module import. I tried to duplicate your nightmare without much success. Download Jabber, unzip, untar to C:\jabberpy0.4-0. run cmd cd c:\jabberpy0.4-0 python setup.py install python >>Python 2.2.2 (#37, Nov 26 2002, 10:24:37) [MSC 32 bit (Intel)] on win32 Type "copyright", "credits" or "license" for more information. >>> import jabber >>> dir(jabber) ['Client', 'Component', 'Connection', 'False', 'Iq', 'JID', 'Log', 'Message', 'NS_AGENT', 'NS_AGENTS', 'NS_AUTH', 'NS_BROWSE', 'NS_CLIENT', 'NS_COMP_ACCEPT', 'NS_COMP_CONNECT', 'NS_DELAY', 'NS_LAST', 'NS_OOB', 'NS_PASS', 'NS_PRIVACY', 'NS_P_COMMANDS', 'NS_P_DISC_INFO', 'NS_P_DISC_ITEMS', 'NS_P_MUC', 'NS_REGISTER', 'NS_ROSTER', 'NS_RPC', 'NS_SERVER', 'NS_TIME', 'NS_VCARD', 'NS_VERSION', 'NS_XDATA', 'NS_XENCRYPTED', 'NS_XEVENT', 'NS_XEXPIRE', 'NS_XROSTER', 'NS_XSIGNED', 'Presence', 'Protocol', 'RS_ASK_SUBSCRIBE', 'RS_ASK_UNSUBSCRIBE', 'RS_EXT_OFFLINE', 'RS_EXT_ONLINE', 'RS_EXT_PENDING', 'RS_SUB_BOTH', 'RS_SUB_FROM', 'RS_SUB_TO', 'Roster', 'Server', 'True', 'USTR_ENCODING', 'VERSION', 'XDB', '_NS_PROTOCOL', '_NS_P_DISCO', '__builtins__', '__doc__', '__file__', '__name__', 'find', 'replace', 'sha', 'split', 'str', 'time', 'ustr', 'xmlstream'] >>> Now I do see that jabber setup.py places the jabber.py and xmlstream.py files directly in site-packages, and yours end up a level down in a sub-directory called jabber. You didn't read the instructions on the box, i.e running setup.py - did you? We have to assume the reading of README, no? """Installation ------------- >From the untared distrubution directory; As root run; python setup.py install """ Did you manually place the jabber files in the sub-directory under site-packages? If your did, the fault is not entirely yours, IMO. That's where you would expect it to be, and where it should be IMO. OK its there, somehow. Instead of futzing with your paths. Create a file with one word "jabber", and save it in site-packages as jabber.pth. Problem solved. I think the sin is part yours, part Jabber's. I hold Python pretty harmless, except: One big issue I do see. I did not run setup.py from IDLE because you need to run it with a parameter "install". I can't see an obvious way to do that in IDLE. If IDLE is to be one's tool, it *has* to be able to run another Python tool as fundmental as setup.py, IMO. Maybe I'm a moron, too - in missing something obvious here. Or maybe the new IDLE (2.3) will better cater to this issue, or us morons. As to where to save files, etc and etc. - you are asking for more structure than Python chooses to impose on you. Where you will, is fine. Especially as Python is truly cross-platofrm, and what would make sense for Windows probably does not make sense for other platforms. Art From Jason Cunliffe" Message-ID: <001101c34417$07944540$6401a8c0@ValuedSonyCustomer> Art, thanks very much for your feedback on jabber setup. I'll look into it some more. I suspect yesterday I unpacked jabber and then just double clicked on setup.py, confusing it with setup.exe behavior. It flashed a python dos window at me too quickly to read, but did not complain. - What is the difference from double-clicking setup.py compared to running "python setup.py install" ? But jabber installation was only a current example. My point is more general, and more serious, as anticipated by your note about IDLE's problems with install and then the next comment: In fact I realize Everything I said applies with or without idle. They are python shell issues which defy common sense. I know I am not really getting it and have not been for years in this respect with Python. So am guessing/hoping that I am not alone. I used to use PythonWin, and it had a built-in menu to facilitate module installation and path setting. I may go back to that, but I rather get to the heart of the problem. > As to where to save files, etc and etc. - you are asking for more structure > than Python chooses to impose on you. Where you will, is fine. Especially > as Python is truly cross-platofrm, and what would make sense for Windows > probably does not make sense for other platforms. No. I am not asking for Python to impose structure on me. Of course I want to be able to put stuff wherever I damn well feel like. AND understand how to access those, swap, dice and slice in a consistent fashion. In fact, putting stuff where I want to is likely what has got me into this trouble in the first place ;-) And IF python were truly cross-platform it would strive for a consistent solution which also makes good sense for Windows. In practice, I have the impression that most Python docs and the official ones are notably *nix oriented. As I understand it, the newer setup.py is very valuable because often it does work beautifully first time. But also in a magic, dumbing down sort of turnkey way. Often I don't mind. But the Python Way is know and control openly. In my experience installing packages it is never clear what has happened to paths, nor what to do to move them. This is especially problematic when returning to install a newer version and find conflicts like an original folder named, for example, 'jabber' and then later might find it unpacks to 'jabber-0.7-alpha'. - How to manage those? - Should one search the entire file system for example to find python jabber modules? - How to know where the module has been added - in Windows registry, or autoexec.bat or somewhere else. ? - Why not have simple editable central config file strategy for true cross-platform Python module management? Granted, the windows registry is necessary for basic recognition of python so that actions like "python setup.py install" will work. But why not keep everything else under Python's wing? Even if all authors developed perfect packages, and all users installed them 100% per instructions, that still would not address the core issues which all users need to apply for their own files, folders and modules and setting paths for them. thanks Jason From ajs@optonline.net Mon Jul 7 02:50:14 2003 From: ajs@optonline.net (Arthur) Date: Sun, 06 Jul 2003 20:50:14 -0500 Subject: [Edu-sig] Re: PEPTALK: path sanity and newbie Message-ID: <001001c3442a$1c961960$1a02a8c0@BasementDell> >Even if all authors developed perfect packages, and all users installed them >100% per instructions, that still would not address the core issues which >all users need to apply for their own files, folders and modules and setting >paths for them. Not getting it still. In Windows, once you install Python or ActivePython as a self-installing executable there should be no reason, under normal circumstances, to have to touch path issues again. What ever needs to be done with the environment variables, is done at set-up. There are a few things that should be understood, about either using .pth files to extend the search path, or the magic of __init__.py files in sub-directories of the search path. But those are usually developer, distributer issues, not user issues That magic is normally hidden from the user (in the sense they don't *need* to understand it) if the application or library chooses to play by the installation rules. I, for example, don't expect a PyGeo user to have a handle on any of that. It took me a while (we witnesses it here) to understand my "responsibilities" as a distributor of Python software. But it took me a few years to have anything to distribute. Once PyGeo is installed (I am assuming the README instructions are read and followed), one should be able to run a PyGeo script from any directory, using any editor capable of automating nothing more than a call of "python pathtoscript/pygeoscript.py". I find an editor near essential as an intermediary only because I do find navigating paths through Python's os module cumbersome, and since it can't be assumed the the callable script pygeoscript.py is on any path, than one must call it, if at a prompt, either by navigating to its directory, or calling it through its fully qualified pathname. I find it much easier to pull it up in a editor and run it from there (where the call to the fully qualified pathname is essentially automated). Textpad (for Windows), IDLE, SciTE (crossplatform) are the ones I happen to haved used. The Big Guys do emacs or vim. But since I am used to calling Python scripts through an editor, I can get flumaxed when a parameter is needed. Easy in Textpad, possible but a little clumsey (IMO) in SciTE, still don't see it, off hand, in IDLE. Truth is I use IDLE mostly for its interactive prompt, and don't know its editor features very well. That being said, I would say your frustration still sounds a little non-specific. Maybe the fact I had taken a shot at confronting Java classpath issues, when Java was young, helped me approach all these issues as they exist in Python with relative equanimity. The issues I have now are mostly on Linux, and these are usually related to the Linux distribution install of Python, (usually a version or sub-version behind what I might choose to be using), versus the installation of the version I choose to work with. From a brief converstaion with the Red Hat guys who attended the Python conference in DC, I began to understand how strictly their hands are tied by rules related to directory structures of a distribution. And therefore how unavoidable are some of these issues as they exist on Linux. The burden there of getting a handle on a potentially more complex lay of the land with a dual install of Python, ends up on the user, as is normally understood to be so in Linux world. But I would say that I remain convinced that something about your wish list - I don't, again think you are being clear - is related to some unavoidable realities of crossplatform distribution. The kinds of issues over which Python has little to no control. BTW, I have succesfully created full stand-alone, self-installing versions for Windows of both VPython and PyGeo,which include their own Python runtime environment and their own customized versions of SciTE. These installs assume no prior Python installation, nor would they disturb one that existed. Alice (boo!), for example, and many other apps have taken that tack. I may well deploy PyGeo in that form as one alternative. If I ever finish the damn docs. All that being said I can't say, all in all, I have my hands fully around the issue you are trying to express. Beyond some frustration. My suggestion is slow down. Fewer assumptions and preconceptions. Read the damn README - I don't mean to be insulting, but apparently, you didn't. The hardest part might be in being satisfied to start at the beginning. With deliberation. Without shortcuts But I had to come to terms with doing just that, when I was considerably older than you. Art From missive@hotmail.com Mon Jul 7 02:31:24 2003 From: missive@hotmail.com (Lee Harr) Date: Mon, 07 Jul 2003 01:31:24 +0000 Subject: [Edu-sig] Re: PEPTALK: path sanity and newbie mental Message-ID: >- What is the difference from double-clicking setup.py compared to running >"python setup.py install" ? > Well, if the person creating this intends for it to be used in windows, he should be making a windows installer also. It is very simple with distutils... when creating the package, use python setup.py bdist_wininst and the installer is created automatically. I can create a windows installer using distutils from my FreeBSD machine. I always do this, even though I never use any windows software myself. >And IF python were truly cross-platform it would strive for a consistent >solution which also makes good sense for Windows. >In practice, I have the impression that most Python docs and the official >ones are notably *nix oriented. I just find that windows is not a very good software development platform, because it hides too much from would be developers. That said, Python is clearly way ahead of the pack in the cross-platform race. However, I think if you want to be a developer, finding a good shell is a must. It's nice to be able to: 21:29 >cd 21:29 >mkdir dev_area 21:29 >cd dev_area/ 21:29 >setenv PYTHONPATH `pwd` 21:29 >mkdir a_new_package 21:30 >cd a_new_package/ 21:30 >touch __init__.py 21:30 >cat > a_module.py class Foo: pass 21:30 >python Python 2.2.3 (#1, Jun 9 2003, 18:01:50) [GCC 2.95.4 20020320 [FreeBSD]] on freebsd4 Type "help", "copyright", "credits" or "license" for more information. >>>from a_new_package import a_module >>>foo = a_module.Foo() >>> _________________________________________________________________ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail From leif@ambient.2y.net Mon Jul 7 07:29:58 2003 From: leif@ambient.2y.net (Leif Johnson) Date: Mon, 7 Jul 2003 02:29:58 -0400 Subject: [Edu-sig] PEPTALK: path sanity and newbie mental health -- please help In-Reply-To: <000f01c343ed$a67fa840$6401a8c0@ValuedSonyCustomer> References: <000f01c343ed$a67fa840$6401a8c0@ValuedSonyCustomer> Message-ID: <20030707062958.GA29893@microfridge> Hi Jason - > Q: How to see PYTHONPATH? > > >>> PYTHONPATH > Traceback (most recent call last): > File "", line 1, in ? > PYTHONPATH > NameError: name 'PYTHONPATH' is not defined > >>> $PYTHONPATH > SyntaxError: invalid syntax > >>> > > nope :-(( > Since PYTHONPATH is so essential to using Python, surely it would make > sense to make that permanently available to people? > To my mind an intuitive interface would allow direct typing any of the > environment variables in idle shell. Well, being able to set environment variables directly from the Python command line would make it more like shell script, and thus more like Perl, so that's bad. ... just kidding. :-) You pointed this out in your email, though I don't think you realized it. There is indeed a nice, Pythonesque way to check your environment variables, namely the os.environ dictionary : >>> import os >>> for pair in os.environ.items(): print '%s --> %s' % pair In my mind, environment variables are necessarily an operating system service (they are manipulated differently on different platforms), so they should be accessed somehow under the `os' module. You can even set these values using the os.environ dictionary. > If "sys.path" is so essential, then why do I have to import sys all the > time? I think one of the issues is that most of the time you shouldn't need to know what your sys.path is ; it's more of a system administration variable. The fact that you're worried about it implies that you're installing things in nonstandard locations, which is usually assumed to be a power user or system administrator activity. > And why do so many texts talk about PYTHONPATH when what they really mean > is sys.path? The following will never raise an exception, as far as I understand it : >>> for pth in os.environ[PYTHONPATH].split(os.pathsep): ... if pth not in sys.path: raise That is, the value of the sys.path list contains---at the very least---all the values in the PYTHONPATH environment variable. There can be additional values, which are determined by the global Python configuration file (site.py and whatever files it loads). So PYTHONPATH is an environment variable, available to all programs running in the operating system environment, whereas sys.path is a list of strings used internally by the Python interpreter. Actually, the Python interpreter really only uses sys.path ; PYTHONPATH is used as a seed for initializing the elements in the sys.path list when the interpreter starts up. But this is why setting the PYTHONPATH variable is so handy, because you don't have to configure Python to add these paths for you, you can just do it using your operating system and then run Python normally. Or you could modify your Python site configuration file (site.py and sitecustomize.py, as mentioned below). There's more than one way to do it, some guy said once. (Is it illegal to use Larry Wall quotes on a Python mailing list ? :-) > And how do I customize my environment so I don't have to jump through > these hoops every time? It seems like IDLE should provide some way for you to do this, but I looked over the docs and couldn't find a nice solution. So, it looks like you're left with a few options : - Set your PYTHONPATH variable using your operating system. This entails editing your registry, messing with autoexec.bat, or setting your local variables using an obscure dialog. (Try right clicking `My Computer' or the Start menu, and going to `Properties' ... it's a tab somewhere in there.) - Run a script each time you start up IDLE. Based on the IDLE docs , it looks like you could use F5 when you start up IDLE, and then load whatever file you want to run. So you could write up a wee script containing the code you mentioned, which sets up your path : import sys sys.path.append('C:\\PYTHON22\\lib\\site-packages\\jabber') del sys - Alter your site customization files. I'd personally do this by putting the above Python code in C:\PYTHON22\lib\site-packages\sitecustomize.py. > DS #0 -- Display PYTHONPATH when Python boots. Make this a default, which > pros can disable via config value. I kind of like the current default, so that normally your path doesn't show up. (What if your path happens to be really long ? Seems like it would get annoying.) Anyway, you could enable such behavior by putting the following in C:\PYTHON22\lib\site-packages\sitecustomize.py : import sys sys.path.append('C:\\PYTHON22\\lib\\site-packages\\jabber') for p in sys.path: print p del p, sys > DS #2 -- To be able to add to that by setting like this: > > PYTHONPATH = ['C:\\PYTHON22\\Tools\\idle', 'M:\\jasonic\\python', > 'C:\\Python22', 'C:\\PYTHON22\\DLLs', 'C:\\PYTHON22\\lib', > 'C:\\PYTHON22\\lib\\lib-tk', 'C:\\PYTHON22\\lib\\site-packages', > 'C:\\PYTHON22\\lib\\site-packages\\jabber'] <<< the last entry is my > addition > > or by adding or appending: > > PYTHONPATH.add('C:\\PYTHON22\\lib\\site-packages\\jabber') > PYTHONPATH.append('C:\\PYTHON22\\lib\\site-packages\\jabber') I'd definitely use sys.path for this type of manipulation. Doing this is perfectly valid : >>> import sys >>> sys.path = ['foo', 'bar', 'baz'] # not a very functional path ... >>> sys.path.append('C:\\PYTHON22\\lib\\site-packages\\jabber') You could even do this type of manipulation in your sitecustomize.py file so you don't have to remember to do it each time you start IDLE. Again, I think IDLE should have its own `exec this file on startup' configurability, but that's a separate issue. As you point out, there's no direct parallel like this for any other environment variables. But that's ok, because Python only uses the one variable, PYTHONPATH ... all others are pretty much irrelevant. > Ideally there is a single dict which holds all of these and can be easily > viewed and edited anytime on any system the same way and will always be > accessible in the Python shell. Perhaps there already is and I'm too dumb > to have found it. >>> import os >>> os.environ['PYTHONPATH'] = os.pathsep.join(['foo', 'bar', 'baz']) >>> os.environ['PYTHONPATH'] 'foo:bar:baz' >>> os.environ['MYVARIABLE'] = 'myvalue' Use the force, Luke. Or the os.environ dictionary. But good luck, either way. Hope this long message helps. leif -- Leif Morgan Johnson : http://ambient.2y.net/leif/ From urnerk@qwest.net Mon Jul 7 08:58:56 2003 From: urnerk@qwest.net (Kirby Urner) Date: Mon, 07 Jul 2003 00:58:56 -0700 Subject: [Edu-sig] Re: Least used builtins? In-Reply-To: <004101c343f5$cf17d540$6401a8c0@ValuedSonyCustomer> References: <29950-22003706191352212@M2W033.mail2web.com> Message-ID: <5.2.0.9.0.20030707005745.01d45f80@pop.ptld.qwest.net> At 03:35 PM 7/6/2003 -0400, Jason Cunliffe wrote: >Kirby > >> Question: is there a way to get IDLE or PyCrust or another shell to be >both BIG FONT *and* BOLD? Thinking of projecting. I can make IDLE shell >fonts as big as I like, but don't know how to bold 'em. > >I seem to remember discussion about this here quite some time ago. In fact I >was asking the same. I've since learned that the newest IDLE, now part of the latest 2.3 (beta 2), has this feature. There's a check box for 'bold', next to a font size slider. Kirby From urnerk@qwest.net Mon Jul 7 09:30:15 2003 From: urnerk@qwest.net (Kirby Urner) Date: Mon, 07 Jul 2003 01:30:15 -0700 Subject: [Edu-sig] Re: Least used builtins? In-Reply-To: <000e01c343af$397347e0$1a02a8c0@BasementDell> Message-ID: <5.2.0.9.0.20030707005954.01d4b140@pop.ptld.qwest.net> At 06:10 AM 7/6/2003 -0500, you wrote: >I wrote - > >> Kirby writes - > > >The strikes me as unimaginative, plodding. > > > > pitooey., > >To elaborate. I agree that going down the list of built-ins as a teaching >technique is unnecessary. My point is much different than that. As always, >I am more than willing to have my point rejected - but prefer it happen >*after* it is understood. OK, so what IS your much different point? 'pitooey' fails to communicate much. >I go on when I feel that it is only a trivialized version of my point that >is being put on the dung heap. I was mainly responding to the passage attributed to Lulu (as follows): > Yet a fourth matter is that I think it would be slightly easier to teach > Python to beginners if __builtins__ did not include a number of > functions that were extremely difficult to explain to novices... and > that are really only of use to fairly expert Pythoneers. I find that > callable, classmethod, id, intern, and a number of others fall in this > category. My thinking is that anything meant for experts should need to > get imported by specific request. I was countering the above, saying: (a) the content of __builtins__ is not about what's easy or introductory, it's about what's necessary to have the nucleus of a complete language, along with keywords and other syntax and (b) there's no need to feel obligated to plod through all the builtins when teaching Python to beginners I was not responding to your sense of 'betrayal' re the absence of 'copy' as one of the builtins. I responded to that a long time ago and have nothing new to add. >Deja-vu, again. > >Art Appended is a list of built-ins that are callable as functions, not including error and warning objects. You need not import first, to use any of the below. And then we also have the keywords in keyword.kwlist. A lot of these *are* important to know about early, but surely not all of them. Quiz question: what makes something a "keyword" versus a "builtin" other than that some appear on one list, some on the other? I notice that builtins aren't protected from being used as variable names (not a good idea to do this, but possible), whereas true keywords generate a syntax error if you try to rebind them. Also, builtins may be used alone and return their type as built-in functions or objects. Keywords used alone generate more syntax errors. Keywords are too primitive to use alone. They only make sense as syntax elements in more complicated expressions and statements. But beyond the keywords, we have other syntax, such as the operators and stuff like [] () {}. Built-in functions (callable): __import__ abs apply basestring bool buffer callable chr classmethod cmp coerce compile complex copyright credits delattr dict dir divmod enumerate eval execfile file filter float getattr globals hasattr hash help hex id input int intern isinstance issubclass iter len license list locals long map max min object oct open ord pow property range raw_input reduce reload repr round setattr slice staticmethod str sum super tuple type unichr unicode vars xrange zip From Jason Cunliffe" <20030707062958.GA29893@microfridge> Message-ID: <004201c34492$d9d477c0$6401a8c0@ValuedSonyCustomer> > Use the force, Luke. Or the os.environ dictionary. But good luck, either > way. Hope this long message helps. Leif, Yes thanks - great answer! ..I feel better already. os.environ aaah -- what a a wor[l]d of difference between http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=environment+pytho n http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=environ+python > ... you could enable such behavior by putting the following > in C:\PYTHON22\lib\site-packages\sitecustomize.py : > > import sys > sys.path.append('C:\\PYTHON22\\lib\\site-packages\\jabber') > for p in sys.path: print p > del p, sys hmm... Like I said sitecustomize.py does not work for me :-( For example I put a single line in C:\PYTHON22\lib\site-packages\sitecustomize.py import sys Then run IDLE >>> sys Traceback (most recent call last): File "", line 1, in ? sys NameError: name 'sys' is not defined >>> For some reason Python is not running my sitecustomize.py But IDLE does show the file on its Path browser Any ideas? Is there something you have to do to activate sitecustomize.py files ? Both your response and Arthur's imply I am doing something special to require path manipulation. Apart from installing packages and modules by other people, my need is very simple.. I store all my own work on external firewire drives. So even "helloworld.py" need to be accessible in a folder like M:\\jasonic\\python You've provided some valuable strategies. I think I will try to write a sys.path.save() script hack to set my paths quickly from inside python. I imagine I'll need to restart idle but at least I'll have a more portable solution. Presumably it is always safe to edit PYTHONPATH in autoexec.bat from Python. I hope I don't also have to restart windows. thanks again Jason From Jason Cunliffe" Message-ID: <005a01c34493$da65ece0$6401a8c0@ValuedSonyCustomer> > Quiz question: what makes something a "keyword" versus a "builtin" > other than that some appear on one list, some on the other? Yes and a simple witness to that observation is perhaps the Python syntax highlighting settings for my text editor of choice -UltraEdit. /L7"Python" Line Comment = # Escape Char = \ File Extensions = PY PYC SPY /Indent Strings = ":" /Function String = "%[ ,^t]++def[ ]+^([a-zA-Z0-9_]+[ ,^t]++([a-zA-Z0-9_,="' ]++)^):" /Delimiters = []{}()<>="'.,:+ /C1"Reserved Words" and assert break class continue def del elif else except exec finally for from global if import in is lambda map not None or pass print raise range return try while /C2"Built-in Functions" abs apply callable chr cmp coerce compile complex delattr dir divmod eval execfile filter float getattr globals group hasattr hash hex id input int intern isinstance issubclass joinfields len list local long max min match oct open ord pow raw_input reduce reload repr round search setattr slice str splitfields tuple type vars xrange __import__ /C3"__Methods__" __abs__ __add__ __and__ __call__ __cmp__ __coerce__ __del__ __delattr__ __delitem__ __delslice__ __div__ __divmod__ __float__ __getattr__ __getitem__ __getslice__ __hash__ __hex__ __invert__ __int__ __init__ __len__ __long__ __lshift__ __mod__ __mul__ __neg__ __nonzero__ __oct__ __or__ __pos__ __pow__ __radd__ __rdiv__ __rdivmod__ __rmod__ __rpow__ __rlshift__ __rrshift__ __rshift__ __rsub__ __rmul__ __repr__ __rand__ __rxor__ __ror__ __setattr__ __setitem__ __setslice__ __str__ __sub__ __xor__ /C4"__Attributes__" __bases__ __class__ __dict__ __methods__ __members__ __name__ __version__ /C5"Exceptions" ArithmeticError AssertionError AttributeError EOFError Exception FloatingPointError IOError ImportError IndexError KeyError KeyboardInterrupt LookupError MemoryError NameError OverflowError RuntimeError StandardError SyntaxError SystemError SystemExit TypeError ValueError ZeroDivisionError /C6"Common Libs" AST BaseHTTPServer Bastion cmd commands compileall copy CGIHTTPServer Complex dbhash dircmp dis dospath dumbdbm emacs find fmt fnmatch ftplib getopt glob gopherlib grep htmllib httplib ihooks imghdr linecache lockfile macpath macurl2path mailbox mailcap mimetools mimify mutex math Mimewriter newdir ni nntplib ntpath nturl2path os ospath pdb pickle pipes poly popen2 posixfile posixpath profile pstats pyclbr Para quopri Queue rand random regex regsub rfc822 sched sgmllib shelve site sndhdr string sys snmp SimpleHTTPServer StringIO SocketServer tb tempfile toaiff token tokenize traceback tty types tzparse Tkinter urllib urlparse util uu UserDict UserList wave whatsound whichdb whrandom xdrlib zmod /C7"Others" array fnmatch struct self From john.zelle@wartburg.edu Mon Jul 7 15:36:28 2003 From: john.zelle@wartburg.edu (John Zelle) Date: Mon, 07 Jul 2003 09:36:28 -0500 Subject: [Edu-sig] PEPTALK: path sanity and newbie mental health -- please help References: <000f01c343ed$a67fa840$6401a8c0@ValuedSonyCustomer> <20030707062958.GA29893@microfridge> <004201c34492$d9d477c0$6401a8c0@ValuedSonyCustomer> Message-ID: <3F09856C.1050405@wartburg.edu> Hello all, I've been only a lurker on this list, and I hate to prolong this thread, but there is one simple point that I don't think has been addressed yet. Generally, when working on Python programs, you'll want to start an interactive shell, editor, etc. in the directory where your current project resides. Under Windows, the easiest way to do this is to place a shortcut for Python, IDLE or whatever in the directory where you are working. Just make sure that the "Start in:" entry of the shortcut is blank, and the program will fire up using the directory it's currently in as the default working directory. Since Python will load modules from the current directory, this is a quick and easy way to work on your programs without doing any path futzing at all. In Jason's case, a shorcut on his firewire drive should solve the problem described below. Of course, you need to make sure to start Python or IDLE from the shortcut on the drive, not from the Start menu. Cheers, --John Jason Cunliffe wrote: >>Use the force, Luke. Or the os.environ dictionary. But good luck, either >>way. Hope this long message helps. >> >> > >Leif, Yes thanks - great answer! ..I feel better already. > >os.environ >aaah -- what a a wor[l]d of difference between > >http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=environment+pytho >n >http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=environ+python > > > > >>... you could enable such behavior by putting the following >>in C:\PYTHON22\lib\site-packages\sitecustomize.py : >> >> import sys >> sys.path.append('C:\\PYTHON22\\lib\\site-packages\\jabber') >> for p in sys.path: print p >> del p, sys >> >> > >hmm... >Like I said sitecustomize.py does not work for me :-( > >For example I put a single line in >C:\PYTHON22\lib\site-packages\sitecustomize.py > >import sys > >Then run IDLE > > > >>>>sys >>>> >>>> >Traceback (most recent call last): > File "", line 1, in ? > sys >NameError: name 'sys' is not defined > > > >For some reason Python is not running my sitecustomize.py >But IDLE does show the file on its Path browser > >Any ideas? >Is there something you have to do to activate sitecustomize.py files ? > >Both your response and Arthur's imply I am doing something special to >require path manipulation. >Apart from installing packages and modules by other people, my need is very >simple.. >I store all my own work on external firewire drives. So even "helloworld.py" >need to be accessible in a folder like >M:\\jasonic\\python > >You've provided some valuable strategies. >I think I will try to write a sys.path.save() script hack to set my paths >quickly from inside python. I imagine I'll need to restart idle but at least >I'll have a more portable solution. Presumably it is always safe to edit >PYTHONPATH in autoexec.bat from Python. I hope I don't also have to restart >windows. > >thanks again >Jason > > > > >_______________________________________________ >Edu-sig mailing list >Edu-sig@python.org >http://mail.python.org/mailman/listinfo/edu-sig > > > > -- John M. Zelle, Ph.D. | Wartburg College Associate Prof. of CS | Dept. Math/CS/Physics zelle@wartburg.edu | Waverly, Iowa From Jason Cunliffe" Message-ID: <006e01c34498$a123c6a0$6401a8c0@ValuedSonyCustomer> aah!! -- os.environ Thanks to Leif I learn that os.environ hold the key to much of my perplexity. And as with much of Python, and programming in general, it is process of initiation. A crucial part of which is know what to search for.. consider the difference between http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=environment+pytho n and http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=environ+python Likewise among the books I consulted > *Books* > Before writing this, last night along with docs and Google research I went > to my Python shelf and pulled down the following: > > - Python Essential Reference by David M. Beazley > - The Quick Python Book by Darryl Harms and Kenneth Mcdonald > - Python Programming on Win32 by Mark Hammond and Andy Robinson > - Core Python Programming by Wesley Chun > - Python Cookbook edited by Alex Martelli and David Ascher > - Python In A Nutshell by Alex Martelli Only two books from my shelf -- 'Python In A Nutshell' and 'Python Essential Reference' list the word "environ" directly in the index. And even had I thought/known to look up 'os' module, only two books in my collection list os.environ in the index -- 'The Quick Python Book' and David Beazley 'Python Essential Reference ' [the winner for best index in random test] Searching the python.org site for environ or environment is pretty overwhelming, but http://web.pydoc.org/ is a little better. A more direct less overhwleming search I learn is http://starship.python.net/crew/theller/pyhelp.cgi The 'on-ramp' to Python is often much like road signs around New York City. thanks Jason From christian.mascher@gmx.de Mon Jul 7 16:24:22 2003 From: christian.mascher@gmx.de (Christian Mascher) Date: Mon, 07 Jul 2003 17:24:22 +0200 Subject: [Edu-sig] Re: PEPTALK: path sanity and newbie mental health References: <20030707005102.25449.73755.Mailman@mail.python.org> Message-ID: <3F0990A6.D8DE7048@gmx.de> Jason Cunliffe wrote: > PROBLEM #1 > Where to install things on Python and how to access them? > It seems recommended default is to install modules and packages into > Lib/site-packages/some-sub-folder. > > PROBLEM#2 > But what about my personal work? > I can find precious little advice on that.. I can recall how important it was for me to find that very information. I think I learnt it first on Python-Tutor list. And the books don't write much about this, true. When I give my pupils a CD with the Python-installer on it, I also include instructions on setting up the PYTHONPATH after the install: 1. create directory "C:\mypython" to put your (and my) files in 2. edit C:\autoexec.bat with extra line "SET PYTHONPATH C:\mypython" 3. restart computer I'm not telling them anything about sys.path at this stage. So they just have to follow the extra steps, to get it working. They will notice something is wrong, when a supplied module can't be imported. > b) edit autoexec.bat and create a PYTHONPATH entry and then add 'jabber' to > that. > Yikes this seems also too far from python. It uses a syntax I am not certain > about. I look in books and google around, but honestly it's hard to find > just some simple example I can copy. The solution is not too bad if you've grown up with autoexec.bat settings (having started with DOS once, like me). For most computer users today, including my 16 year old pupils, this is something they have never done, never imagined one could do. I agree, batteries-included Python could have a friendlier approach, at least give detailed online help and instructions. > One of the first things all beginners are taught do is save a > "helloworld.py" file. > It is good practice for all software to keep user files separate from system > or application files. Better for sysadmin, maintenance and collaborative > workflow. But, in Python at present the first problem is that creating a > personal folder for scripts outside of the application installation which is > visible to import statements [... and is not in sys.path] I agree, this is one of those annoyances, which could stop people with not enough time on their hands to seriously give Python a try. What I would really appreciate is an optional last stage in the installer, in which you can customize your site, i.e. create your private directory to add to PYTHONPATH, get to know where your sitecustomize file is and what is in it, etc. Then I would just have to tell my pupils 1. check the sitecustomize-option 2. create mypython-directory for personal and local files (which would be added to default sys.path automatically) I still would have to tell them something more than just: "run the installer". But this is a place you wouldn't overlook if you were looking for some solution to your problem (which I think many Newbies encounter). > > sys.path.save() > sys.path.load() > > These would both default to use a clear single file called "PYTHONPATH.py" > created at installation. I think this is no bad idea. Write a PEP. Cheers, Christian From Jason Cunliffe" <3F0990A6.D8DE7048@gmx.de> Message-ID: <003401c344b3$118d1800$6401a8c0@ValuedSonyCustomer> > What I would really appreciate is an optional last stage in the > installer, in which you can customize your site, i.e. create your > private directory to add to PYTHONPATH, get to know where your > sitecustomize file is and what is in it, etc. > Then I would just have to tell my pupils > 1. check the sitecustomize-option > 2. create mypython-directory for personal and local files > (which would be added to default sys.path automatically) Christian, thanks very much for your comments. The installer idea is an excellent one I think, and much more in keeping with the rest of the software world these days. It is quite rare to come across such a minimal installer like Python's. > > sys.path.save() > > sys.path.load() > > > > These would both default to use a clear single file called "PYTHONPATH.py" > > created at installation. > > I think this is no bad idea. Write a PEP. Thanks for the encouragement. I was beginning to think I was crazy ;-) Jason From Jason Cunliffe" <20030707062958.GA29893@microfridge> <004201c34492$d9d477c0$6401a8c0@ValuedSonyCustomer> <3F09856C.1050405@wartburg.edu> Message-ID: <003c01c344b5$54654c40$6401a8c0@ValuedSonyCustomer> > Under Windows, the easiest way to do this is to place a shortcut for > Python, IDLE or whatever in the directory where you are working. Just > make sure that the "Start in:" entry of the shortcut is blank, and the > program will fire up using the directory it's currently in as the > default working directory. Since Python will load modules from the > current directory, this is a quick and easy way to work on your programs > without doing any path futzing at all. John Thanks -- this is an great little tip. Navigating directories has been also another rather obscure and tedious aspect of using Python. An unnecessary one too I feel. mkdir chdir etc take some sleuthing. My google research tells me others have been quite perplexed by these simple tasks. ...more broken beer bottles and tire shreds on the on-ramp of the Python Super Highway... I suspect I've been dangerously corrupted by using Rebol's "simple tasks should be simple" philosophy. And also by myriad sophisticated multimedia apps - which all recognize users need for strong configuration and customization access. I am not proposing to dumb python down -- rather to smarten it up. >From a marketing perspective it would be something like -- so ask users especially teachers and newbies what are ten major obstacles they remember when getting up to speed on Python. Then see if there is are sensible improvements which address some of those experiences. This is not about modifying the language - it is about acknowledging valid needs, workflow and assumptions, especially for beginners. Python is awesome and worth every effort as lifetime skill I feel. Jason From brian@macnevin.net Mon Jul 7 20:23:36 2003 From: brian@macnevin.net (BJ MacNevin) Date: Mon, 7 Jul 2003 12:23:36 -0700 Subject: [Edu-sig] Would a simplified Python UI for MiddleSchool students be worth the effort? References: <000f01c343ed$a67fa840$6401a8c0@ValuedSonyCustomer> <20030707062958.GA29893@microfridge> <004201c34492$d9d477c0$6401a8c0@ValuedSonyCustomer> <3F09856C.1050405@wartburg.edu> <003c01c344b5$54654c40$6401a8c0@ValuedSonyCustomer> Message-ID: <001e01c344bd$43e58990$6401a8c0@Kai> Heck, I AM a teacher. Heh heh. And I'm thinkin' of going the Python route next year... perhaps the year after when I'll have a LOT more experience. Think it's MSW Logo until then. BUT! I was so pleased to get the Tkinter Turtle routines running! Sure, there are some kids that can abstract things and get all excited about rearranging letters and numbers, etc. But a lot of people in general like the visual pleasure of seeing things work. *sigh* My own self-imposed project (long way off from where I am right now... I think) is to create a programme that starts up like MSWLogo or Microworld Logo, but uses Python as its core. In the time I've spend on Python so far, I've been REALLY impressed with how natural the expressions are; perhap seven moreso than Logo. And that kids can take this MUCH farther than I show them in a limited amount of time is very clear to me. Talk about easy induction and no ceiling. Of course, the absolute basics necessary for turtle graphics leave me torn. On the one hand, such an easy programme would be awesome to use and teach from; but to what extent would it obscure the objectofied beauty of the language? Hmmm. I'm clueless as yet. BJ MacNevin http://www.macnevin.net/mrmac ----- Original Message ----- From: "Jason Cunliffe" To: Cc: "John Zelle" Sent: Monday, July 07, 2003 11:26 AM Subject: Re: [Edu-sig] PEPTALK: path sanity and newbie mental health -- please help > > Under Windows, the easiest way to do this is to place a shortcut for > > Python, IDLE or whatever in the directory where you are working. Just > > make sure that the "Start in:" entry of the shortcut is blank, and the > > program will fire up using the directory it's currently in as the > > default working directory. Since Python will load modules from the > > current directory, this is a quick and easy way to work on your programs > > without doing any path futzing at all. > > John > > Thanks -- this is an great little tip. > Navigating directories has been also another rather obscure and tedious > aspect of using Python. > An unnecessary one too I feel. mkdir chdir etc take some sleuthing. > My google research tells me others have been quite perplexed by these simple > tasks. > ...more broken beer bottles and tire shreds on the on-ramp of the Python > Super Highway... > > I suspect I've been dangerously corrupted by using Rebol's "simple tasks > should be simple" philosophy. > And also by myriad sophisticated multimedia apps - which all recognize users > need for strong configuration and customization access. > > I am not proposing to dumb python down -- rather to smarten it up. > >From a marketing perspective it would be something like -- so ask users > especially teachers and newbies what are ten major obstacles they remember > when getting up to speed on Python. Then see if there is are sensible > improvements which address some of those experiences. > > This is not about modifying the language - it is about acknowledging valid > needs, workflow and assumptions, especially for beginners. > Python is awesome and worth every effort as lifetime skill I feel. > > Jason > > > _______________________________________________ > Edu-sig mailing list > Edu-sig@python.org > http://mail.python.org/mailman/listinfo/edu-sig > From john.zelle@wartburg.edu Mon Jul 7 21:11:48 2003 From: john.zelle@wartburg.edu (John Zelle) Date: Mon, 07 Jul 2003 15:11:48 -0500 Subject: [Edu-sig] Would a simplified Python UI for MiddleSchool students be worth the effort? References: <000f01c343ed$a67fa840$6401a8c0@ValuedSonyCustomer> <20030707062958.GA29893@microfridge> <004201c34492$d9d477c0$6401a8c0@ValuedSonyCustomer> <3F09856C.1050405@wartburg.edu> <003c01c344b5$54654c40$6401a8c0@ValuedSonyCustomer> <001e01c344bd$43e58990$6401a8c0@Kai> Message-ID: <3F09D404.8030904@wartburg.edu> BJ, This is slightly off from where you're going, but I'm taking a writing break from my Python textbook at the moment, and happened to see your post. I've developed a very simply graphics package for my book that is a thin wrapper over Tkinter. I designed the package for use in intro courses with a few goals: 1. Make it really easy for students to draw nice pictures (they love this). 2. Actually teach them something about computer graphics in the process. 3. Teach them about objects while they're at it. 4. Allow them to build (very) simple GUIs with the same package. 5. Don't force them into event-driven programming until they've mastered some basic programming. My package is not turtle-based (although we have implemented turtles in it as a project and there is some vestigial turtle code in the source), because goals 1 and 4 are not really served by turtles (and 3 is iffy). Although it's written for college freshmen, I think the package would be suitable for middle school students. If you are interested in looking at this, you can see the version from last fall on my Python page: http://mcsp.wartburg.edu/zelle/python. If you look at the draft text there, a section at the end of Chapter 5 that documents the graphics API. I am currently working on a few updates that go with the new version of the text. I'll be putting the updated graphics package on the site soon. Cheers, --John BJ MacNevin wrote: >Heck, > >I AM a teacher. Heh heh. And I'm thinkin' of going the Python route next >year... perhaps the year after when I'll have a LOT more experience. Think >it's MSW Logo until then. BUT! I was so pleased to get the Tkinter Turtle >routines running! Sure, there are some kids that can abstract things and get >all excited about rearranging letters and numbers, etc. But a lot of people >in general like the visual pleasure of seeing things work. *sigh* > >My own self-imposed project (long way off from where I am right now... I >think) is to create a programme that starts up like MSWLogo or Microworld >Logo, but uses Python as its core. In the time I've spend on Python so far, >I've been REALLY impressed with how natural the expressions are; perhap >seven moreso than Logo. > >And that kids can take this MUCH farther than I show them in a limited >amount of time is very clear to me. Talk about easy induction and no >ceiling. Of course, the absolute basics necessary for turtle graphics leave >me torn. > >On the one hand, such an easy programme would be awesome to use and teach >from; but to what extent would it obscure the objectofied beauty of the >language? Hmmm. I'm clueless as yet. > >BJ MacNevin > >http://www.macnevin.net/mrmac > >----- Original Message ----- >From: "Jason Cunliffe" >To: >Cc: "John Zelle" >Sent: Monday, July 07, 2003 11:26 AM >Subject: Re: [Edu-sig] PEPTALK: path sanity and newbie mental health -- >please help > > > > >>>Under Windows, the easiest way to do this is to place a shortcut for >>>Python, IDLE or whatever in the directory where you are working. Just >>>make sure that the "Start in:" entry of the shortcut is blank, and the >>>program will fire up using the directory it's currently in as the >>>default working directory. Since Python will load modules from the >>>current directory, this is a quick and easy way to work on your programs >>>without doing any path futzing at all. >>> >>> >>John >> >>Thanks -- this is an great little tip. >>Navigating directories has been also another rather obscure and tedious >>aspect of using Python. >>An unnecessary one too I feel. mkdir chdir etc take some sleuthing. >>My google research tells me others have been quite perplexed by these >> >> >simple > > >>tasks. >>...more broken beer bottles and tire shreds on the on-ramp of the Python >>Super Highway... >> >>I suspect I've been dangerously corrupted by using Rebol's "simple tasks >>should be simple" philosophy. >>And also by myriad sophisticated multimedia apps - which all recognize >> >> >users > > >>need for strong configuration and customization access. >> >>I am not proposing to dumb python down -- rather to smarten it up. >>>From a marketing perspective it would be something like -- so ask users >>especially teachers and newbies what are ten major obstacles they >> >> >remember > > >>when getting up to speed on Python. Then see if there is are sensible >>improvements which address some of those experiences. >> >>This is not about modifying the language - it is about acknowledging valid >>needs, workflow and assumptions, especially for beginners. >>Python is awesome and worth every effort as lifetime skill I feel. >> >>Jason >> >> >>_______________________________________________ >>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 > > > > -- John M. Zelle, Ph.D. | Wartburg College Associate Prof. of CS | Dept. Math/CS/Physics zelle@wartburg.edu | Waverly, Iowa From ajsiegel@optonline.net Mon Jul 7 23:52:06 2003 From: ajsiegel@optonline.net (ajsiegel@optonline.net) Date: Mon, 07 Jul 2003 18:52:06 -0400 Subject: [Edu-sig] Path sanity? Message-ID: <1900f4194abf.194abf1900f4@optonline.net> Jason - I have reread your posts, and - guess what - I object. In tone, and content. >From the title, onward. Path sanilty, implying that the status quo is path insanity. Harsh. And a very, very premature judgment, IMO. What the responses to your post prove, to me, is there are multiple possible strategies for the solution to the problem you perceive. To the extent there really is a problem at all. Frankly, I still don't understand truly what it is. The current directory is effectively on sys.path. One can always import pitoeey.py from a script in that same directory, without touching anything. Why doesn't that handle the cases that a newbie might be concerned with. Why would directory structures be coming into play before one learned how to handle directory structures for modules. Which, of course, can be handled in ways that are not insane, by a long measure. I think the idea/trick for having IDLE start up in your current working directory was a good one, and solves the issue where you want to simply import from that directory in an interactive session. All simple cases seemed to be covered, fairly well out of the box. And complex cases are solved by understanding the tool and the options it provides at the level appropriate for someone creating complex cases. And as long as any 3rd party library is properly installed, it will also be available. There is a good tool to help both the developer and user make sure that is accomplished - if used according to the instruction on *its* box. And, as mentioned, with the facilities of disutils, there is no good reason that a self installing executable for Windows would not be an option. Unless the distributor chooses not to make it an option. Perhaps out of conscious lack of concern for the user working on Windows. Which, of course, is her perogative. Seems that is the Jabber case. There is almost an assumption that it is being installled on *nix. And, BTW, please stop holding Rebol up to us, me. Its help system is as it should be, as is its installation procedure. The problem that Python does not meet your expectations of behaving like Rebol is, IMO,your problem. Not Python's. Good back to Russia ;) Art Art From missive@hotmail.com Tue Jul 8 02:03:01 2003 From: missive@hotmail.com (Lee Harr) Date: Tue, 08 Jul 2003 01:03:01 +0000 Subject: [Edu-sig] Re: Would a simplified Python UI for MiddleSchool students Message-ID: >Of course, the absolute basics necessary for turtle graphics leave >me torn. You might want to look at pygsear (http://www.nongnu.org/pygsear/) which is built on python and pygame. It is more intended to get kids interested in programming by having them create games, but one of the first things I made was a turtle graphics module (actually, it's a penguin ;o) Look in examples. There is no gui yet, but I have been thinking about adding one.... >but to what extent would it obscure the objectofied beauty of the >language? I'd say no more so than printing out "hello world" or your name or other strange t3xt tricks. Should we forsake output altogether? :o) _________________________________________________________________ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail From urnerk@qwest.net Tue Jul 8 07:21:39 2003 From: urnerk@qwest.net (Kirby Urner) Date: Mon, 07 Jul 2003 23:21:39 -0700 Subject: [Edu-sig] PEPTALK: path sanity and newbie mental health -- please help In-Reply-To: <3F09856C.1050405@wartburg.edu> References: <000f01c343ed$a67fa840$6401a8c0@ValuedSonyCustomer> <20030707062958.GA29893@microfridge> <004201c34492$d9d477c0$6401a8c0@ValuedSonyCustomer> Message-ID: <5.2.0.9.0.20030707230934.01fae588@pop.ptld.qwest.net> At 09:36 AM 7/7/2003 -0500, John Zelle wrote: >Hello all, > >I've been only a lurker on this list, and I hate to prolong this thread, >but there is one simple point that I don't think has been addressed yet. >Generally, when working on Python programs, you'll want to start an >interactive shell, editor, etc. in the directory where your current >project resides. I don't think that's so important, if the path is setup right. My "Start in:" directory for a Python shell is always something like D:\PROGRA~1\Python22 i.e. is the Python root directory. None of my own working files will be there. They're in site packages, a subfolder thereof (packages) or maybe in pythonroot\work. I use the .pth approach i.e. when I boot Python, the contents of .pth files extend the set of directories in which Python looks for modules (Arthur suggested this as well). Look at Python's own libraries -- they're not in the root that the shell, by default, starts in. >Under Windows, the easiest way to do this is to place a shortcut for >Python, IDLE or whatever in the directory where you are working. Just make >sure that the "Start in:" entry of the shortcut is blank, and the program >will fire up using the directory it's currently in as the default working >directory. Since Python will load modules from the current directory, this >is a quick and easy way to work on your programs without doing any path >futzing at all. But I don't want to create different icons for each subdirectory I might be working in. >In Jason's case, a shorcut on his firewire drive should solve the problem >described below. Of course, you need to make sure to start Python or IDLE >from the shortcut on the drive, not from the Start menu. > >Cheers, > >--John Or he might create a .pth file containing the line m:\pystuff (or whatever). To me that seems the easiest solution. Kirby From urnerk@qwest.net Tue Jul 8 07:27:26 2003 From: urnerk@qwest.net (Kirby Urner) Date: Mon, 07 Jul 2003 23:27:26 -0700 Subject: [Edu-sig] PEPTALK: path sanity and newbie mental health -- please help In-Reply-To: <3F09856C.1050405@wartburg.edu> References: <000f01c343ed$a67fa840$6401a8c0@ValuedSonyCustomer> <20030707062958.GA29893@microfridge> <004201c34492$d9d477c0$6401a8c0@ValuedSonyCustomer> Message-ID: <5.2.0.9.0.20030707232554.02a35a70@pop.ptld.qwest.net> At 09:36 AM 7/7/2003 -0500, John Zelle wrote: >Under Windows, the easiest way to do this is to place a shortcut for >Python, IDLE or whatever in the directory where you are working. Just make >sure that the "Start in:" entry of the shortcut is blank, and the program >will fire up using the directory it's currently in as the default working >directory. Since Python will load modules from the current directory, this >is a quick and easy way to work on your programs without doing any path >futzing at all. On second thought, this does seem to be a viable alternative to the .pth method. Both are very simple to implement. Kirby From urnerk@qwest.net Tue Jul 8 08:21:55 2003 From: urnerk@qwest.net (Kirby Urner) Date: Tue, 08 Jul 2003 00:21:55 -0700 Subject: [Edu-sig] Would a simplified Python UI for MiddleSchool students be worth the effort? In-Reply-To: <001e01c344bd$43e58990$6401a8c0@Kai> References: <000f01c343ed$a67fa840$6401a8c0@ValuedSonyCustomer> <20030707062958.GA29893@microfridge> <004201c34492$d9d477c0$6401a8c0@ValuedSonyCustomer> <3F09856C.1050405@wartburg.edu> <003c01c344b5$54654c40$6401a8c0@ValuedSonyCustomer> Message-ID: <5.2.0.9.0.20030707233006.017b5020@pop.ptld.qwest.net> At 12:23 PM 7/7/2003 -0700, you wrote: >routines running! Sure, there are some kids that can abstract things and get >all excited about rearranging letters and numbers, etc. But a lot of people >in general like the visual pleasure of seeing things work. *sigh* Some kids even like both! (and some neither :-( -- sigh again). But the act of programming itself is a lot like rearranging letters and numbers, is very text-oriented, visual programming notwithstanding (you still usually end up writing code snippets behind the scenes). So whereas I'm all for flashy visuals, a well-rounded diet should include some regular expressions and such, IMO (but not exclusively -- turtle graphics with Tkinter, yes! (including the demo). And Kevin implemented some turtle stuff in PythonCard that's pretty nifty as well). And lets not forget the cellular automata (perhaps a bridge between text and graphics, as simple CA may be displayed using a kind of 'ascii art' -- see below). Kirby >>> def nextgen(g, rule): """ Compute a next generation based on some rule """ newline = '' for i in range(len(g)): cells = g[i%s] + g[(i+1)%s] + g[(i+2)%s] # % for modulo newline = "%s%s" % (newline, rule[cells]) # %s for string return newline[-1]+newline[:-1] # wrap last around to first >>> def run(g, n, rule): """ compute n generations, starting with g, using a rule """ print g for i in range(n): g = nextgen(g, rule) print g >>> # 3-cell pattern in top row below generates element in 2nd row >>> # (this implementation wraps right edge around to left) >>> rule110 = dict(zip( ['AAA','AA.','A.A','A..','.AA','.A.','..A','...'], [ '.', 'A', 'A', '.', 'A', 'A', 'A', '.'])) >>> dots = '.' * 30 >>> start = dots + 'A' + dots >>> run(start, 40, rule110) ..............................A.............................. .............................AA.............................. ............................AAA.............................. ...........................AA.A.............................. ..........................AAAAA.............................. .........................AA...A.............................. ........................AAA..AA.............................. .......................AA.A.AAA.............................. ......................AAAAAAA.A.............................. .....................AA.....AAA.............................. ....................AAA....AA.A.............................. ...................AA.A...AAAAA.............................. ..................AAAAA..AA...A.............................. .................AA...A.AAA..AA.............................. ................AAA..AAAA.A.AAA.............................. ...............AA.A.AA..AAAAA.A.............................. ..............AAAAAAAA.AA...AAA.............................. .............AA......AAAA..AA.A.............................. ............AAA.....AA..A.AAAAA.............................. ...........AA.A....AAA.AAAA...A.............................. ..........AAAAA...AA.AAA..A..AA.............................. .........AA...A..AAAAA.A.AA.AAA.............................. ........AAA..AA.AA...AAAAAAAA.A.............................. .......AA.A.AAAAAA..AA......AAA.............................. ......AAAAAAA....A.AAA.....AA.A.............................. .....AA.....A...AAAA.A....AAAAA.............................. ....AAA....AA..AA..AAA...AA...A.............................. ...AA.A...AAA.AAA.AA.A..AAA..AA.............................. ..AAAAA..AA.AAA.AAAAAA.AA.A.AAA.............................. .AA...A.AAAAA.AAA....AAAAAAAA.A.............................. AAA..AAAA...AAA.A...AA......AAA.............................. A.A.AA..A..AA.AAA..AAA.....AA.A.............................A AAAAAA.AA.AAAAA.A.AA.A....AAAAA............................AA .....AAAAAA...AAAAAAAA...AA...A...........................AA. ....AA....A..AA......A..AAA..AA..........................AAA. ...AAA...AA.AAA.....AA.AA.A.AAA.........................AA.A. ..AA.A..AAAAA.A....AAAAAAAAAA.A........................AAAAA. .AAAAA.AA...AAA...AA........AAA.......................AA...A. AA...AAAA..AA.A..AAA.......AA.A......................AAA..AA. AA..AA..A.AAAAA.AA.A......AAAAA.....................AA.A.AAAA .A.AAA.AAAA...AAAAAA.....AA...A....................AAAAAAA... >>> From glingl@aon.at Tue Jul 8 09:51:04 2003 From: glingl@aon.at (Gregor Lingl) Date: Tue, 08 Jul 2003 10:51:04 +0200 Subject: [Fwd: Re: [Edu-sig] Would a simplified Python UI for MiddleSchool students be worth the effort?] Message-ID: <3F0A85F8.1020601@aon.at> This is a multi-part message in MIME format. --------------080000080003010108090204 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Kirby Urner schrieb: > At 12:23 PM 7/7/2003 -0700, you wrote: > >> routines running! Sure, there are some kids that can abstract things >> and get >> all excited about rearranging letters and numbers, etc. But a lot of >> people >> in general like the visual pleasure of seeing things work. *sigh* > > > Some kids even like both! (and some neither :-( -- sigh again). > ... > > So whereas I'm all for flashy visuals, a well-rounded diet should > include some regular expressions and such, IMO (but not exclusively > -- turtle graphics with Tkinter, yes! (including the demo). And > Kevin implemented some turtle stuff in PythonCard that's pretty > nifty as well). Could this be part of your well-roundet diet? (Aims at visualizing some fundamental concepts of computer-science) ################################ # Mini Lindenmayer tool ############################### from __future__ import generators from turtle import Pen def ersetze( folge, ersetzungsregeln, n ): for i in range(n): neuefolge = "" for element in folge: neuefolge = neuefolge + ersetzungsregeln.get(element,element) folge = neuefolge return folge def lindenmayer(turtle, axiom = "", ersetzungsregeln = {}, tiefe = 1, schritt = 5, winkel = 90, startpos = (0,-120), startdir = 90, updating = 20): turtle.step, turtle.angle = schritt, winkel zeichnung = ersetze(axiom, ersetzungsregeln, tiefe) turtle.start(startpos, startdir) return turtle.zeichne(zeichnung, turtle.standardregeln(), updating) class LPen(Pen): def __init__(self): Pen.__init__(self) self.tstack = [] def start(self, startpos, startdir): self.up() self.goto(startpos) self.left(startdir) self.down() self.tracer(1) self.tracer(0) def zeichne( self, befehle, regeln, updating ): i = 0 for b in befehle: try: regeln[b]() except: pass i += 1 if i % updating == 0: self.tracer(1) self.tracer(0) # Wir machen draus einen Generator! yield 1 ################################ # Standardregeln ################################ def r(self): self.right(self.angle) def l(self): self.left(self.angle) def f(self): self.up() self.forward(self.step) def F(self): self.down() self.forward(self.step) def turn(self): self.left(180) def save(self): self.tstack.append( (self.pos(), self.heading()) ) def load(self): position, richtung = self.tstack.pop() self.up() self.goto(position) self.setheading(richtung) def standardregeln(self): return {"-":self.l, "+":self.r, "F": self.F, "f":self.f, "|": self.turn, "[":self.save, "]":self.load} # 2 examples for Lindenmayer plants: kraut = { "axiom" : "G", "ersetzungsregeln" : { "G" : "GFX[+G][-G]", "X" : "X[-FFF][+FFF]FX" }, "tiefe" : 5, "schritt" : 4.5, "winkel" : 180.0/7, "startpos" : (-90, -128), "startdir" : 90 } busch = { "axiom" : "F", "ersetzungsregeln" : { "F" : "FF+[+F-F-F]-[-F+F+F]" }, "tiefe" : 3, "schritt" : 9, "winkel" : 180.0/8, "startpos" : (60, -128), "startdir" : 90, "updating" : 20 } l1, l2 = lindenmayer(LPen(), **kraut), lindenmayer(LPen(), **busch) done = 0 while done < 2: done = 0 for l in l1, l2: try: l.next() except: done += 1 raw_input() > > And lets not forget the cellular automata (perhaps a bridge between > text and graphics, as simple CA may be displayed using a kind of > 'ascii art' -- see below). Or this: from Tkinter import Tk, Canvas, mainloop from Canvas import Rectangle class ZACanvas(Canvas): def __init__(self, root, NX=59, NY=40, feldbreite=4): self.NX, self.NY = NX, NY w,h = NX*feldbreite, NY*feldbreite Canvas.__init__(self, root, width = w+1, height = h+1, bg = "yellow") self.pack() self.farbe = ["white", "red", "green", "blue", "yellow"] self.gitter = {} for spalte in range(NX): for zeile in range(NY): x0 = 2 + spalte * feldbreite y0 = 2 + zeile * feldbreite x1 = x0 + feldbreite y1 = y0 + feldbreite r = Rectangle(self, x0, y0, x1, y1, fill="black", outline="black") self.gitter[(spalte,zeile)] = r def set(self,feld,farbe): self.gitter[feld]['fill'] = farbe self.gitter[feld]['outline'] = farbe def draw(self,welt): for y in range(self.NY): for x in range(self.NX): self.set((x,y), self.farbe[welt[y][x]]) self.update() def ZA(code, spalten = 59, zeilen = 40): code = code[:13] code = code + "0"*(13-len(code)) welt = [] altezeile = [0]*spalten altezeile[spalten//2] = 1 for z in range(0,zeilen): welt.append(altezeile) neuezeile = [0]*spalten for s in range(1,spalten-1): summe = altezeile[s-1]+altezeile[s]+altezeile[s+1] neuezeile[s] = int(code[summe]) altezeile = neuezeile return welt ZACanvas(Tk()).draw(ZA("0211021")) mainloop() If necessary, ZACanvas-class could be supplied by the teacher. Remark: (Easy) implementation in wxPython, will result in faster graphics. (Code for both examples attached, for your convenience) Gregor --------------080000080003010108090204 Content-Type: text/plain; name="lindenmayer_gen_demo.py" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="lindenmayer_gen_demo.py" ################################ # Mini Lindenmayer tool ############################### from __future__ import generators from turtle import Pen def ersetze( folge, ersetzungsregeln, n ): for i in range(n): neuefolge = "" for element in folge: neuefolge = neuefolge + ersetzungsregeln.get(element,element) folge = neuefolge return folge def lindenmayer(turtle, axiom = "", ersetzungsregeln = {}, tiefe = 1, schritt = 5, winkel = 90, startpos = (0,-120), startdir = 90, updating = 20): turtle.step, turtle.angle = schritt, winkel zeichnung = ersetze(axiom, ersetzungsregeln, tiefe) turtle.start(startpos, startdir) return turtle.zeichne(zeichnung, turtle.standardregeln(), updating) class LPen(Pen): def __init__(self): Pen.__init__(self) self.tstack = [] def start(self, startpos, startdir): self.up() self.goto(startpos) self.left(startdir) self.down() self.tracer(1) self.tracer(0) def zeichne( self, befehle, regeln, updating ): i = 0 for b in befehle: try: regeln[b]() except: pass i += 1 if i % updating == 0: self.tracer(1) self.tracer(0) # Wir machen draus einen Generator! yield 1 ################################ # Standardregeln ################################ def r(self): self.right(self.angle) def l(self): self.left(self.angle) def f(self): self.up() self.forward(self.step) def F(self): self.down() self.forward(self.step) def turn(self): self.left(180) def save(self): self.tstack.append( (self.pos(), self.heading()) ) def load(self): position, richtung = self.tstack.pop() self.up() self.goto(position) self.setheading(richtung) def standardregeln(self): return {"-":self.l, "+":self.r, "F": self.F, "f":self.f, "|": self.turn, "[":self.save, "]":self.load} # 2 examples for Lindenmayer plants: kraut = { "axiom" : "G", "ersetzungsregeln" : { "G" : "GFX[+G][-G]", "X" : "X[-FFF][+FFF]FX" }, "tiefe" : 5, "schritt" : 4.5, "winkel" : 180.0/7, "startpos" : (-90, -128), "startdir" : 90 } busch = { "axiom" : "F", "ersetzungsregeln" : { "F" : "FF+[+F-F-F]-[-F+F+F]" }, "tiefe" : 3, "schritt" : 9, "winkel" : 180.0/8, "startpos" : (60, -128), "startdir" : 90, "updating" : 20 } l1, l2 = lindenmayer(LPen(), **kraut), lindenmayer(LPen(), **busch) done = 0 while done < 2: done = 0 for l in l1, l2: try: l.next() except: done += 1 raw_input() --------------080000080003010108090204 Content-Type: text/plain; name="za_demo.py" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="za_demo.py" from Tkinter import Tk, Canvas, mainloop from Canvas import Rectangle class ZACanvas(Canvas): def __init__(self, root, NX=59, NY=40, feldbreite=4): self.NX, self.NY = NX, NY w,h = NX*feldbreite, NY*feldbreite Canvas.__init__(self, root, width = w+1, height = h+1, bg = "yellow") self.pack() self.farbe = ["white", "red", "green", "blue", "yellow"] self.gitter = {} for spalte in range(NX): for zeile in range(NY): x0 = 2 + spalte * feldbreite y0 = 2 + zeile * feldbreite x1 = x0 + feldbreite y1 = y0 + feldbreite r = Rectangle(self, x0, y0, x1, y1, fill="black", outline="black") self.gitter[(spalte,zeile)] = r def set(self,feld,farbe): self.gitter[feld]['fill'] = farbe self.gitter[feld]['outline'] = farbe def draw(self,welt): for y in range(self.NY): for x in range(self.NX): self.set((x,y), self.farbe[welt[y][x]]) self.update() def ZA(code, spalten = 59, zeilen = 40): code = code[:13] code = code + "0"*(13-len(code)) welt = [] altezeile = [0]*spalten altezeile[spalten//2] = 1 for z in range(0,zeilen): welt.append(altezeile) neuezeile = [0]*spalten for s in range(1,spalten-1): summe = altezeile[s-1]+altezeile[s]+altezeile[s+1] neuezeile[s] = int(code[summe]) altezeile = neuezeile return welt ZACanvas(Tk()).draw(ZA("0211021")) mainloop() --------------080000080003010108090204-- From ajs@optonline.net Tue Jul 8 15:52:39 2003 From: ajs@optonline.net (Arthur) Date: Tue, 08 Jul 2003 09:52:39 -0500 Subject: [Edu-sig] A small essay in my own defense Message-ID: <000501c34560$94211980$1a02a8c0@BasementDell> A small essay in my own defense. problem 1. I don't believe in CP4E. Because "everyone" ain't interested or capable. Why be coercive and unrealistic - out of the box? CP4E is, to me, just a marketing slogan and IMO, a poorly chosen one. problem 2. I insist that I should not feel inhibited in stating problem 1, as I have. On principal. problem 3. I have no interest, stand-alone, as to the user count of Python in the school systems. I get no royalties. problem 4. I am incredibly enthusiastic about the possiblities for the use of Python as a catalyst for some changes in the way things are taught. It is those changes that interest me, primarily, not the Python head count. problem 5. Any expectation that discussions can be had about education, in general, and education and technology in particular, circa 2003, clean of "politics" is an unrealistic expectation. And its own form of politics. problem 6. I am glad Python is not Rebol, and hope (and am confident) it will remain not so.. Art From urnerk@qwest.net Tue Jul 8 15:44:58 2003 From: urnerk@qwest.net (Kirby Urner) Date: Tue, 08 Jul 2003 07:44:58 -0700 Subject: [Edu-sig] Would a simplified Python UI for MiddleSchool students be worth the effort? In-Reply-To: <5.2.0.9.0.20030707233006.017b5020@pop.ptld.qwest.net> References: <001e01c344bd$43e58990$6401a8c0@Kai> <000f01c343ed$a67fa840$6401a8c0@ValuedSonyCustomer> <20030707062958.GA29893@microfridge> <004201c34492$d9d477c0$6401a8c0@ValuedSonyCustomer> <3F09856C.1050405@wartburg.edu> <003c01c344b5$54654c40$6401a8c0@ValuedSonyCustomer> Message-ID: <5.2.0.9.0.20030708074231.01f21c50@pop.ptld.qwest.net> As one of you kindly pointed out, s is not defined in the function below. I was "simplifying" after cutting/pasting into email -- a dangerous step. Comment shows fix: > >>> def nextgen(g, rule): > """ > Compute a next generation based on some rule > """ > newline = '' s = len(g) # s for size > for i in range(len(g)): # except now just use s for len(g) > cells = g[i%s] + g[(i+1)%s] + g[(i+2)%s] # % for modulo > newline = "%s%s" % (newline, rule[cells]) # %s for string > return newline[-1]+newline[:-1] # wrap last around to first Gracias... Kirby From urnerk@qwest.net Tue Jul 8 15:54:42 2003 From: urnerk@qwest.net (Kirby Urner) Date: Tue, 08 Jul 2003 07:54:42 -0700 Subject: [Fwd: Re: [Edu-sig] Would a simplified Python UI for MiddleSchool students be worth the effort?] In-Reply-To: <3F0A85F8.1020601@aon.at> Message-ID: <5.2.0.9.0.20030708074645.0333fea8@pop.ptld.qwest.net> At 10:51 AM 7/8/2003 +0200, Gregor Lingl wrote: >Could this be part of your well-roundet diet? (Aims at visualizing >some fundamental concepts of computer-science) Sure, why not? Plus you remind me to think more about multi- language programming (in the sense of variable, class and function names). This looks sort of like an L-systems setup, yes? I'd forgotten what the L stands for. FYI I also used Python to play with L-systems in July 2000 at http://www.inetarena.com/~pdx4d/ocn/lsystems.html (not a completed project -- lots of broken links by now; I should go back and clean up that page). I'll run your code later (taking it with me on my laptop as I head down to OSCON for day 2). Kirby From urnerk@qwest.net Tue Jul 8 16:07:28 2003 From: urnerk@qwest.net (Kirby Urner) Date: Tue, 08 Jul 2003 08:07:28 -0700 Subject: [Edu-sig] A small essay in my own defense In-Reply-To: <000501c34560$94211980$1a02a8c0@BasementDell> Message-ID: <5.2.0.9.0.20030708075550.03343bb0@pop.ptld.qwest.net> At 09:52 AM 7/8/2003 -0500, Arthur wrote: >problem 4. I am incredibly enthusiastic about the possiblities for the use >of Python as a catalyst for some changes in the way things are taught. I think this is where you and I most overlap. As to head count, to me it seems an inevitable megatrend that Python will continue to grow in popularity. It's a side-effect, not a number we have to push on directly through Java-style hype. If a much cooler high level language suddenly shows up, that'd have an inhibitory effect, but at this point in time, Python has a very secure niche and is thriving. CP4E is clever enough as a *direction*. I like to say that knowing something about programming is like knowing something about internal combustion engines. Yet we're not all mechanics. It's just helpful to know "how things work". To get there, it's good to program, at least a little (more than the VCR). I just learned yesterday that even the latest Photoshop from Adobe has Python bindings, so you can script it. Confirmation anyone? Hands-on experience? My Photoshop is too old. Anyone with an office job with a computer on the desk is probably up for automating a few tedious tasks from time to time. But we're not all office workers, I realize that. Is knowing how to program (even a bit) becoming something like knowing some piano forte during the Victorian period, for young eligible women especially? If it improves your chances of getting a date, then you *know* it's an important skill. We're not there yet -- except in some circles. Kirby From arkamir@softhome.net Tue Jul 8 17:26:38 2003 From: arkamir@softhome.net (Conrad Koziol) Date: 08 Jul 2003 09:26:38 -0700 Subject: [Edu-sig] Student teaching and tutorials In-Reply-To: <20030708072301.20684.53375.Mailman@mail.python.org> References: <20030708072301.20684.53375.Mailman@mail.python.org> Message-ID: <1057681598.4882.31.camel@quercus.home.net> Hello everyone,Im going into highschool next year and I've been following this thread for some time now. The biggest problem I have faced with learning python is the lack of showing the point of the lesson in a way you could use it in programming. For example, THE QUICK PYTHON BOOK, an excellent source teaches about lists, tuples, and dictionaries among other things, yet if fails to show them used in other ways than stand alone examples such as: a = [ 1, 2, "first"] print a They don't seem to develop it much further. I quickly understand lists and stuff and then they jump into class and control flow which is more complicated. What the greatest teaching tool ever for me would a python tutorial on how to build a message board/forum. This would include everything from lists to classes to htmlgen. It would also show me a practical use for everything, by using something I am highly interested in. Web development and game development are the two things held in regard by students. I would also love an easier tutorial for total beginners branching off pygame. The trick to teaching anything is to go over the same things over and over, but each way in a slightly different manner or point of view while holding the readers interest. As a last note, I find many tutorials helpful, but something they all lack is a test or review at the end. This would help me greatly, because that is how i am used to learning things in school. Thanks, Conrad From glingl@aon.at Tue Jul 8 17:57:52 2003 From: glingl@aon.at (Gregor Lingl) Date: Tue, 08 Jul 2003 18:57:52 +0200 Subject: [Edu-sig] OOPS - ATTENTION (SORRY!) References: <3F0A85F8.1020601@aon.at> Message-ID: <3F0AF810.1070705@aon.at> This is a multi-part message in MIME format. --------------050802000304090702070408 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit WHAT A MESS! The code for the L-System I posted in the morning doesn't run with the turtle module, which comes with Python 2.2. I did some small enhancements, especially I added the methods pos() an heading() (used in the code mentioned above) to the turtle module, when I published my book "Python für Kids" in January (which uses the turtle-module prominently). It is put on the book's accompanying CD.. (The turtle module which comes with Python is located at Python22\Lib\lib-tk. Replace it with this one.) When I posted this code I forgot, that it makes use of these enhancements. Sorry for the inconvenience. I'll attach the enhanced turtle - module. (And the L-system demo again) Incidentally (and surprisingly) most of these additions have found their way into the turtle-module of Python 2.3, although the name of the method pos() has been changed to position(). I''d like to know if and how this code could be ported to Kevin's turtle-stuff on PythonCard or to - yes, I don't remember exactly - some turtle-module implemented for PyGame. Grand excuse and regards Gregor --------------050802000304090702070408 Content-Type: text/plain; name="turtle.py" Content-Transfer-Encoding: 8bit Content-Disposition: inline; filename="turtle.py" # LogoMation-like turtle graphics from math import * # Also for export import Tkinter class Error(Exception): pass class RawPen: def __init__(self, canvas): self._canvas = canvas self._items = [] self._tracing = 1 self._arrow = 0 self._set_fullcircle(360.0) # alter self.degrees() Aufruf self.reset() # Das ist die alte degrees - Funktion # doch ohne Standardwert def _set_fullcircle(self, fullcircle): self._fullcircle = fullcircle self._invradian = pi / (fullcircle * 0.5) # nur noetig, wenn nicht eh schon Gradmass eingestellt def degrees(self): if self._fullcircle == 360.0: return self._set_fullcircle(360.0) self._angle = self._angle / self._invradian # nur noetig wenn nicht eh schon Bogenmass eingestellt def radians(self): # Die folgende Anweisung koennte unterbleiben, da # in diesem Fall self._invradian den Wert 1 hat. # Finde es so aber klarer if self._fullcircle == 2.0*pi: return self._angle = self._angle * self._invradian self._set_fullcircle(2.0*pi) def reset(self, width = None, height = None): canvas = self._canvas if width: canvas["width"] = width if height: canvas["height"] = height self._canvas.update() width = canvas.winfo_width() height = canvas.winfo_height() if width <= 1: width = canvas['width'] if height <= 1: height = canvas['height'] self._origin = float(width)/2.0, float(height)/2.0 self._position = self._origin self._angle = 0.0 self._drawing = 1 self._width = 1 self._color = "black" self._filling = 0 self._path = [] self._tofill = [] self.clear() canvas._root().tkraise() def clear(self): self.fill(0) canvas = self._canvas items = self._items self._items = [] for item in items: canvas.delete(item) self._delete_turtle() self._draw_turtle() def tracer(self, flag): self._tracing = flag if not self._tracing: self._delete_turtle() self._draw_turtle() def forward(self, distance): x0, y0 = start = self._position x1 = x0 + distance * cos(self._angle*self._invradian) y1 = y0 - distance * sin(self._angle*self._invradian) self._goto(x1, y1) def backward(self, distance): self.forward(-distance) def left(self, angle): self._angle = (self._angle + angle) % self._fullcircle self._draw_turtle() def right(self, angle): self.left(-angle) def up(self): self._drawing = 0 def down(self): self._drawing = 1 def width(self, width): self._width = float(width) def color(self, *args): if not args: raise Error, "no color arguments" if len(args) == 1: color = args[0] if type(color) == type(""): # Test the color first try: id = self._canvas.create_line(0, 0, 0, 0, fill=color) except Tkinter.TclError: raise Error, "bad color string: %s" % `color` self._set_color(color) return try: r, g, b = color except: raise Error, "bad color sequence: %s" % `color` else: try: r, g, b = args except: raise Error, "bad color arguments: %s" % `args` assert 0 <= r <= 1 assert 0 <= g <= 1 assert 0 <= b <= 1 x = 255.0 y = 0.5 self._set_color("#%02x%02x%02x" % (int(r*x+y), int(g*x+y), int(b*x+y))) def _set_color(self,color): self._color = color self._draw_turtle() def write(self, arg, move=0): x, y = start = self._position x = x-1 # correction -- calibrated for Windows item = self._canvas.create_text(x, y, text=str(arg), anchor="sw", fill=self._color) self._items.append(item) if move: x0, y0, x1, y1 = self._canvas.bbox(item) self._goto(x1, y1) self._draw_turtle() def fill(self, flag): if self._filling: path = tuple(self._path) smooth = self._filling < 0 if len(path) > 2: item = self._canvas._create('polygon', path, {'fill': self._color, 'smooth': smooth}) self._items.append(item) self._canvas.lower(item) if self._tofill: for item in self._tofill: self._canvas.itemconfigure(item, fill=self._color) self._items.append(item) self._path = [] self._tofill = [] self._filling = flag if flag: self._path.append(self._position) def circle(self, radius, extent=None): if extent is None: extent = self._fullcircle x0, y0 = self._position xc = x0 - radius * sin(self._angle * self._invradian) yc = y0 - radius * cos(self._angle * self._invradian) # weil self._angle eventuell im Bogenmass vorliegt: # 90.0 ----> self._fullcircle / 4 if radius >= 0.0: start = self._angle - self._fullcircle / 4 else: start = self._angle + self._fullcircle / 4 extent = -extent ## start und extent für den Bogen werden ## c_start und arc_extent zugewiesen ## weil sie für Canvas.create_arc unbedingt ## im Gradmass angegeben werden muessen if self._fullcircle == 2 * pi: arc_start = start * 180.0 / pi arc_extent = extent * 180.0 / pi else: arc_start = start arc_extent = extent if self._filling: if abs(extent) >= self._fullcircle: item = self._canvas.create_oval(xc-radius, yc-radius, xc+radius, yc+radius, width=self._width, outline="") self._tofill.append(item) item = self._canvas.create_arc(xc-radius, yc-radius, xc+radius, yc+radius, style="chord", start=arc_start, extent=arc_extent, width=self._width, outline="") self._tofill.append(item) if self._drawing: if abs(extent) >= self._fullcircle: item = self._canvas.create_oval(xc-radius, yc-radius, xc+radius, yc+radius, width=self._width, outline=self._color) self._items.append(item) # print xc-radius,yc-radius,xc+radius,yc+radius # print start, extent, self._width, self._color item = self._canvas.create_arc(xc-radius, yc-radius, xc+radius, yc+radius, style="arc", start=arc_start, extent=arc_extent, width=self._width, outline=self._color) self._items.append(item) angle = start + extent x1 = xc + abs(radius) * cos(angle * self._invradian) y1 = yc - abs(radius) * sin(angle * self._invradian) self._angle = (self._angle + extent) % self._fullcircle self._position = x1, y1 if self._filling: self._path.append(self._position) self._draw_turtle() def goto(self, *args): if len(args) == 1: try: x, y = args[0] except: raise Error, "bad point argument: %s" % `args[0]` else: try: x, y = args except: raise Error, "bad coordinates: %s" % `args[0]` x0, y0 = self._origin self._goto(x0+x, y0-y) def _goto(self, x1, y1): x0, y0 = start = self._position self._position = map(float, (x1, y1)) if self._filling: self._path.append(self._position) if self._drawing: if self._tracing: dx = float(x1 - x0) dy = float(y1 - y0) distance = hypot(dx, dy) nhops = int(distance) item = self._canvas.create_line(x0, y0, x0, y0, width=self._width, capstyle="round", fill=self._color) try: for i in range(1, 1+nhops): x, y = x0 + dx*i/nhops, y0 + dy*i/nhops self._canvas.coords(item, x0, y0, x, y) self._draw_turtle((x,y)) self._canvas.update() self._canvas.after(10) # in case nhops==0 self._canvas.coords(item, x0, y0, x1, y1) self._canvas.itemconfigure(item, arrow="none") except Tkinter.TclError: # Probably the window was closed! return else: item = self._canvas.create_line(x0, y0, x1, y1, width=self._width, capstyle="round", fill=self._color) self._items.append(item) self._draw_turtle() def _draw_turtle(self,position=[]): if not self._tracing: return if position == []: position = self._position x,y = position distance = 8 dx = distance * cos(self._angle*self._invradian) dy = distance * sin(self._angle*self._invradian) self._delete_turtle() self._arrow = self._canvas.create_line(x-dx,y+dy,x,y, width=self._width, arrow="last", capstyle="round", fill=self._color) self._canvas.update() def _delete_turtle(self): if self._arrow != 0: self._canvas.delete(self._arrow) self._arrow = 0 ## Extensions by g.l. def pos(self): x, y = self._position ox,oy = self._origin return x - ox, oy - y def heading(self): return self._angle def _vector_to(self, *args): if len(args) == 2: x, y = args else: arg = args[0] if isinstance(arg, RawPen): x, y = arg.pos() else: x, y = arg x0, y0 = self.pos() return x - x0, y - y0 def towards(self, *args): vx, vy = self._vector_to(*args) return (atan2(vy,vx) / self._invradian) % self._fullcircle def setheading(self,angle): self._angle = angle % self._fullcircle self._draw_turtle() _root = None _canvas = None _pen = None class Pen(RawPen): def __init__(self): global _root, _canvas if _root is None: _root = Tkinter.Tk() _root.wm_protocol("WM_DELETE_WINDOW", self._destroy) if _canvas is None: # XXX Should have scroll bars _canvas = Tkinter.Canvas(_root, background="white") _canvas.pack(expand=1, fill="both") RawPen.__init__(self, _canvas) def _destroy(self): global _root, _canvas, _pen root = self._canvas._root() if root is _root: _pen = None _root = None _canvas = None root.destroy() def _getpen(): global _pen if not _pen: _pen = Pen() return _pen def degrees(): _getpen().degrees() def radians(): _getpen().radians() def reset(width=None, height=None): _getpen().reset(width,height) def clear(): _getpen().clear() def tracer(flag): _getpen().tracer(flag) def forward(distance): _getpen().forward(distance) def backward(distance): _getpen().backward(distance) def left(angle): _getpen().left(angle) def right(angle): _getpen().right(angle) def up(): _getpen().up() def down(): _getpen().down() def width(width): _getpen().width(width) def color(*args): apply(_getpen().color, args) def write(arg, move=0): _getpen().write(arg, move) def fill(flag): _getpen().fill(flag) def circle(radius, extent=None): _getpen().circle(radius, extent) def goto(*args): apply(_getpen().goto, args) ## Extensions by g.l. def pos(): return _getpen().pos() def heading(): return _getpen().heading() def towards(*args): return apply(_getpen().towards, args) def setheading(angle): _getpen().setheading(angle) def demo(): reset() tracer(1) up() backward(100) down() # draw 3 squares; the last filled width(3) for i in range(3): if i == 2: fill(1) for j in range(4): forward(20) left(90) if i == 2: color("maroon") fill(0) up() forward(30) down() width(1) color("black") # move out of the way tracer(0) up() right(90) forward(100) right(90) forward(100) right(180) down() # some text write("startstart", 1) write("start", 1) color("red") # staircase for i in range(5): forward(20) left(90) forward(20) right(90) # filled staircase fill(1) for i in range(5): forward(20) left(90) forward(20) right(90) fill(0) # more text write("end") if __name__ == '__main__': _root.mainloop() if __name__ == '__main__': # demo() pass --------------050802000304090702070408 Content-Type: text/plain; name="lindenmayer_gen_demo.py" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="lindenmayer_gen_demo.py" ################################ # Mini Lindenmayer tool ############################### from __future__ import generators from turtle import Pen def ersetze( folge, ersetzungsregeln, n ): for i in range(n): neuefolge = "" for element in folge: neuefolge = neuefolge + ersetzungsregeln.get(element,element) folge = neuefolge return folge def lindenmayer(turtle, axiom = "", ersetzungsregeln = {}, tiefe = 1, schritt = 5, winkel = 90, startpos = (0,-120), startdir = 90, updating = 20): turtle.step, turtle.angle = schritt, winkel zeichnung = ersetze(axiom, ersetzungsregeln, tiefe) turtle.start(startpos, startdir) return turtle.zeichne(zeichnung, turtle.standardregeln(), updating) class LPen(Pen): def __init__(self): Pen.__init__(self) self.tstack = [] def start(self, startpos, startdir): self.up() self.goto(startpos) self.left(startdir) self.down() self.tracer(1) self.tracer(0) def zeichne( self, befehle, regeln, updating ): i = 0 for b in befehle: try: regeln[b]() except: pass i += 1 if i % updating == 0: self.tracer(1) self.tracer(0) # Wir machen draus einen Generator! yield 1 ################################ # Standardregeln ################################ def r(self): self.right(self.angle) def l(self): self.left(self.angle) def f(self): self.up() self.forward(self.step) def F(self): self.down() self.forward(self.step) def turn(self): self.left(180) def save(self): self.tstack.append( (self.pos(), self.heading()) ) def load(self): position, richtung = self.tstack.pop() self.up() self.goto(position) self.setheading(richtung) def standardregeln(self): return {"-":self.l, "+":self.r, "F": self.F, "f":self.f, "|": self.turn, "[":self.save, "]":self.load} # 2 examples for Lindenmayer plants: kraut = { "axiom" : "G", "ersetzungsregeln" : { "G" : "GFX[+G][-G]", "X" : "X[-FFF][+FFF]FX" }, "tiefe" : 5, "schritt" : 4.5, "winkel" : 180.0/7, "startpos" : (-90, -128), "startdir" : 90 } busch = { "axiom" : "F", "ersetzungsregeln" : { "F" : "FF+[+F-F-F]-[-F+F+F]" }, "tiefe" : 3, "schritt" : 9, "winkel" : 180.0/8, "startpos" : (60, -128), "startdir" : 90, "updating" : 20 } l1, l2 = lindenmayer(LPen(), **kraut), lindenmayer(LPen(), **busch) done = 0 while done < 2: done = 0 for l in l1, l2: try: l.next() except: done += 1 raw_input() --------------050802000304090702070408-- From glingl@aon.at Tue Jul 8 17:59:32 2003 From: glingl@aon.at (Gregor Lingl) Date: Tue, 08 Jul 2003 18:59:32 +0200 Subject: [Fwd: Re: [Edu-sig] Would a simplified Python UI for MiddleSchool students be worth the effort?] References: <5.2.0.9.0.20030708074645.0333fea8@pop.ptld.qwest.net> Message-ID: <3F0AF874.50909@aon.at> plese look at the OOPS - ATTENTION - posting !!! Kirby Urner schrieb: > At 10:51 AM 7/8/2003 +0200, Gregor Lingl wrote: > >> Could this be part of your well-roundet diet? (Aims at visualizing >> some fundamental concepts of computer-science) > > > Sure, why not? Plus you remind me to think more about multi- > language programming (in the sense of variable, class and > function names). > > This looks sort of like an L-systems setup, yes? Yes. > I'd forgotten > what the L stands for. L - indenmayer, he was a biologist who invented this in 1968 (!) to model shapes of plants. > > FYI I also used Python to play with L-systems in July 2000 at > http://www.inetarena.com/~pdx4d/ocn/lsystems.html > (not a completed project -- lots of broken links by now; I > should go back and clean up that page). > > I'll run your code later (taking it with me on my laptop as > I head down to OSCON for day 2). Hmmm! Hope you received my tturtle-module correction in time. Regards, Gregor > > Kirby > From ajs@optonline.net Tue Jul 8 19:18:15 2003 From: ajs@optonline.net (Arthur) Date: Tue, 08 Jul 2003 13:18:15 -0500 Subject: [Edu-sig] re: A small essay in my own defense Message-ID: <000801c3457d$4d1dc110$1a02a8c0@BasementDell> Kirby writes - >As to head count, to me it seems an inevitable megatrend that Python will continue to grow in popularity. I agree. And my track record is not bad. In an early converstaion with the managing partner of a firm I joined - earliesh 1990's - I brought up Linux. He asked me how much it costs. $0. He found it hard to take me seriously after that. And with Managing Partners, one never seems to get the last laugh - under any circumstances. I consider myself a good community member, not a bad one. In Guido's Euro-Python lecture, which I just read, he talks about his continuing interest in CP4E - mentions PyGame and a Python clone of Karel the Robot, dubbed "Guido the Robot" - whether that is the working name, or Guido was just being tongue in cheek - I don't know. As long as Python is under the radar, its under the radar. Which might not be forever. And what goes in a freewheeling community of iconoclasts, might not make it at Community School Board 6. I hope that "Guido the Robot" ends up as wonderful educational software. And dearly hope it is called something else. And maybe we should keep our clothes on, next time the opportunity for the cover of L:inux Journal comes up. Beyond boys with toys, I hope. Art From mats@laplaza.org Tue Jul 8 18:34:41 2003 From: mats@laplaza.org (Mats Wichmann) Date: Tue, 08 Jul 2003 11:34:41 -0600 Subject: [Edu-sig] PEPTALK: path sanity and newbie mental health -- please help In-Reply-To: <003c01c344b5$54654c40$6401a8c0@ValuedSonyCustomer> References: <000f01c343ed$a67fa840$6401a8c0@ValuedSonyCustomer> <20030707062958.GA29893@microfridge> <004201c34492$d9d477c0$6401a8c0@ValuedSonyCustomer> <3F09856C.1050405@wartburg.edu> Message-ID: <5.1.0.14.1.20030708105723.00a92480@mail.laplaza.org> talking about chdir/mkdir being exposed in Python: >I suspect I've been dangerously corrupted by using Rebol's "simple tasks >should be simple" philosophy. It's a matter of perspective. From the language's perspective, navigating the storage heirarchy of the underlying system is not all that simple a task (certainly more complex than adding a new element to a list, say), and relegating that to a specific os-interface module that reminds you of that seems like a clean interface. Actually it's not that simple to new computer users, either. I have conversations with folks who have a more or less recent version of something like Windows, which tries to isolate user files into a folder "My Documents", which is hidden in a very strange path that causes problems when you use an application that defaults its open/save path to the installation directory, which is usually C:\Program Files\package ... how do you then navigate from there to My Documents? Or even know that you need to? So maybe in spite of this we can come up with an approach that would make it easier? -- mats From Jason Cunliffe" Message-ID: <004501c34582$a1b0f620$6401a8c0@ValuedSonyCustomer> > I just learned yesterday that > even the latest Photoshop from Adobe has Python bindings, so you can > script it. Confirmation anyone? Hands-on experience? My Photoshop > is too old. Yes I remember posting ages ago about Python API for Photoshop.. "Writing Python Plug-ins for Adobe After Effects and Photoshop" by Grant J. Munsey, Adobe Systems O'Reilly Open Source Convention, July 23-27, 2001 http://conferences.oreillynet.com/cs/os2001/view/e_sess/1327 It seems to have been a rather hidden project but not abandoned. Photoshop now has an 'Actions' palette which is very useful and easy to use. Minimal button and list based gui allows creation, editing and nesting of macros. I am 99% sure however that 'Actions' are based on their earlier exploratory Python API , but Adobe seem to have decided to keep 'programming' out of the marketed scenario. "Look you can automate Photoshop with out having to be a programmer" sort of attitude. I have Photoshop 7.0 on Win32 but I can't see any Python interface right now, nor mention in Help file. I suggest also to check the mailing list: "PythonPhotoshop -- Python Actions Plug-in for Adobe Photoshop Discussion " http://opensource.adobe.com/mailman/listinfo/pythonphotoshop Adobe have implemented Python API for After Effects, which is their other essential media app. After Effects is at least an order of magnitude more sophisticated than Photoshop, and because of its use for time/CPU-intensive media composting for Film and TV, automation and smart batch handling are essential. Profound Effects are a company who sell an intermediary commercial product around After Effects Python API called "Useful Things" - 'An infinite supply of plug-ins' for Adobe® After Effects http://www.profoundeffects.com/ Profound Effects is run by Perry Kivolowitz an old pro who started out doing wonderful image batch processing for Amiga based on ARexx, the superb interprocess communication language bundled with all Amigas. ARexx fostered wonderful scripting extensions to most applications and raised a generation of savvy media interface programmers. There are several commercial media software with Python APIs. The number grows every day and docs and community along with it. These are likely to be good job areas for Python programmers. Disney and ILM have also chosen Python so ther must a lot of in-house work which may someday surface. I have about posted Python media APIs here before. I hope this short review is helpful to the list: 3D PoserPro has Python API Poser 4 required the ProPack for Python . I think the new Poser5 includes it now. not sure. The docs are in transition. http://www.curiouslabs.com/ http://www.mmhk.com/e/products/curiouslabs/poser4pp/p4pp-python.htm Blender has Python API. Nan, the Dutch development company suffered economic collapse. But happily the Blender user community rallied, and raised some or all of the $100,000 dollars and blender was liberated as open source and free for ever! There are currently good efforts to fully document and strengthen the Python API. Not surprisingly Trojan horse of a scripting API cannot be kept secret too long .Once inside the gates it starts to take over :-) Very popular in Europe. http://www.blender3d.com/ http://www.blender.org/ http://www.blender.org/modules/documentation/225PythonDoc/index.html Caligari Truespace has Python API. I've not played seriously with Calgiari Truespace for many years and its python interface has been on-again off again. I think its on-again since http://www.caligari.com/ Python is becoming the default scripting language for many media, modeling and animation apps. The only threat it faces is that so many software companies are now understandably taking advantage of .NET It makes their lives easier. Hopefully Python.NET will soon be ready for prime time also. GIS Manifold System has Python API [also thanks to my lobbying and their listening] Amazing value - only $245 http://manifold.net/products/mfd50pro/mfd50pro_home.html Hipparchus will soon have Python API [also thanks to my lobbying and their listening] http://www.geodyssey.com/ -- Jason From missive@hotmail.com Tue Jul 8 22:22:03 2003 From: missive@hotmail.com (Lee Harr) Date: Tue, 08 Jul 2003 21:22:03 +0000 Subject: [Edu-sig] Re: Student teaching and tutorials Message-ID: >Web development and game development are the two things held in >regard by students. I would also love an easier tutorial for total >beginners branching off pygame. >As a last >note, I find many tutorials helpful, but something they all lack is a >test or review at the end. This is my book that is based on pygame: http://staff.easthighschool.net/lee/computers/book/ Each section has a set of exercises, and the exercises have quiz-like questions in order to get in and see my solutions. Let me know if this helps... My plan is to extend the book to web-programming (with zope and/or twisted) and gui programming (pyqt/pygtk/etc) but I have not had much feedback, so I have kind of slowed down. _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From glingl@aon.at Tue Jul 8 22:54:11 2003 From: glingl@aon.at (Gregor Lingl) Date: Tue, 08 Jul 2003 23:54:11 +0200 Subject: [Edu-sig] Re: Student teaching and tutorials References: Message-ID: <3F0B3D83.6040302@aon.at> Lee Harr schrieb: > > > This is my book that is based on pygame: > > http://staff.easthighschool.net/lee/computers/book/ > > Each section has a set of exercises, and the exercises have > quiz-like questions in order to get in and see my solutions. > Let me know if this helps... Looks very interesting! BTW: yesterday (no joke!) I discovered, that ther is a function hypot(x,y) in module math. Maybe helpful for young students ;-) Do you think it would be easy to implement the mini - Lsystem - example (posted 12 hours ago) using pygsear (instead of my extended turtle.py) ? Regards, Gregor > > > My plan is to extend the book to web-programming (with zope > and/or twisted) and gui programming (pyqt/pygtk/etc) but I have > not had much feedback, so I have kind of slowed down. > > _________________________________________________________________ > MSN 8 with e-mail virus protection service: 2 months FREE* > http://join.msn.com/?page=features/virus > > > _______________________________________________ > Edu-sig mailing list > Edu-sig@python.org > http://mail.python.org/mailman/listinfo/edu-sig > > From ajs@optonline.net Wed Jul 9 13:57:59 2003 From: ajs@optonline.net (Arthur) Date: Wed, 09 Jul 2003 07:57:59 -0500 Subject: [Edu-sig] Re: Student teaching and tutorials Message-ID: <000501c34619$ba5dc4e0$1a02a8c0@BasementDell> >What the greatest teaching tool ever for me would a >python tutorial on how to build a message board/forum. I strongly suspect that such a tutorials already exists. In the form of working programs, which you can take apart, and analyze, and break, and then fix, and change, and break again, and fix again. But it might be necessary to be a bit patient, and take a step at a time. Understanding some of the basics of networking (I don't) before you try to go on to something more full blown, like a message board. I second Lee's recommendation that his book and his pygear software might be a good place to start. http://staff.easthighschool.net/lee/computers/book/ I do know that at least one of his demos show how to make a pygame game into a multi-player network game, with Twisted. Appropriate, because Twisted, which started by younger folks developing a multi-player gaming environment in Python, has become an extremely important and visible Python project. Please *don't* wait for someone to write the precise tutorial you might have in mind. Everything you need to know is out there. If you are willing to learn how to learn - using the work many people have generously made available on the Internet, for free, and with nothing hidden from view. Lee tells it to you straight. """It is my belief that the only way to know what a computer can do, and what you can make a computer do, is to try to make the computer do what you want it to do. In other words: You cannot learn to program by reading a book. You must write code. Lots of code. As you read this book, keep that in mind. Try the examples, certainly, but if the examples or the text inspires an idea of your own, by all means work on that for a while. The book will be here. You can always come back and pick up where you were. Play, have fun, see what you can do, then come back and read some more. It is the best way to learn.""" The only step further that I can imagine from Lee's approach, is a book focused as a tutorial on using Open Source resources in learning to program. Learning how to learn, circa 2003. Good idea, Art. Art From ajs@optonline.net Wed Jul 9 14:31:58 2003 From: ajs@optonline.net (Arthur) Date: Wed, 09 Jul 2003 08:31:58 -0500 Subject: [Edu-sig] re: A small essay in my own defense Message-ID: <000501c3461e$794df060$1a02a8c0@BasementDell> Kirby writes - >CP4E is clever enough as a *direction*. I like to say that knowing >something about programming is like knowing something about internal >combustion engines. Yet we're not all mechanics. It's just helpful >to know "how things work". To me, the question than becomes one of semantics. How far down the road toward a redefinition of the word "programming" are we allowing ourselves to go. BIG ISSUE, in my book. BIG, BIG ISSUE. Did I metion I think the issue is significant? Art From ajs@optonline.net Wed Jul 9 15:05:39 2003 From: ajs@optonline.net (Arthur) Date: Wed, 09 Jul 2003 09:05:39 -0500 Subject: [Edu-sig] re: A small essay in my own defense Message-ID: <000501c34623$2e557ce0$1a02a8c0@BasementDell> >To me, the question than becomes one of semantics. >How far down the road toward a redefinition of the >word "programming" are we allowing ourselves to go Which is also, I think, related to a sense of responsibility to a larger community - where I guess my first loyalties lie. I have no interest in provoking, for example, the DrScheme people to murder by competing with their substantial efforts by playing with semantics. As we are defining "programming", is the claim made on the edu-sig page that CP4E is simply a different approach to accomplishing what the DrScheme folks are trying to accomplish, defensible. I have substantial doubt.. So I wonder how the DrScheme folks might feel. As far as I am concnerned, the DrScheme folks have shown great restraint. I would hate to have to "go back to Russia" myself, and defend them, should they decide to no longer hold their fire. Art From missive@hotmail.com Wed Jul 9 14:33:39 2003 From: missive@hotmail.com (Lee Harr) Date: Wed, 09 Jul 2003 13:33:39 +0000 Subject: [Edu-sig] Re: Student teaching and tutorials Message-ID: >>This is my book that is based on pygame: >> >>http://staff.easthighschool.net/lee/computers/book/ >> >Looks very interesting! >BTW: yesterday (no joke!) I discovered, that ther is a function >hypot(x,y) in module math. Maybe helpful for young students ;-) > Good point. I found about 10 places in my code where I had used sqrt() instead. >Do you think it would be easy to implement the >mini - Lsystem - example (posted 12 hours ago) using pygsear >(instead of my extended turtle.py) ? > I just made a new version (http://savannah.nongnu.org/files/?group=pygsear) which includes translations of your code. I cannot guarantee it does exactly the same thing it did before, but it does something interesting :o) Here is an excerpt from examples/penguin.py : def cellular(self, code="04444333221", cellsize=4): """Adapted from code posted to edu-sig@python.org by Gregor Lindl""" w, h = conf.WINSIZE cols = w/cellsize lines = h/cellsize code = code[:13] # What does the 13 mean? code = code + "0"*(13-len(code)) world = [] topline = [0]*cols topline[cols/2] = 1 for z in range(lines): world.append(topline) newline = [0]*cols for s in range(1, cols-1): sum = topline[s-1] + topline[s] + topline[s+1] newline[s] = int(code[sum]) topline = newline for y in range(lines): for x in range(cols): color = COLORS[world[y][x]] self.moveTo((x*cellsize, y*cellsize)) self.square(cellsize, color=color, width=0) def lindenmayer(self, axiom="F", regulator={"F":"FF+[+F-F-F]-[-F+F+F]"}, deep=3, walked=9, angle=180/8.0, startpos=None, startdeg=None): """Adapted from code posted to edu-sig@python.org by Gregor Lindl""" self.tstack = [] def l(angle=angle): self.left(angle) def r(angle=angle): self.right(angle) def turn(): self.left(180) def f(n=walked): self.penUp() self.forward(n) def F(n=walked): self.penDown() self.forward(n) def save(): self.tstack.append((self.getPosition(), self.getDeg())) def load(): position, deg = self.tstack.pop() self.moveTo(position) self.turnTo(deg) regulate = {"-":l, "+":r, "F": F, "f":f, "|": turn, "[":save, "]":load} def replace(follow, regulator, n): for i in range(n): newfollow = "" for element in follow: newfollow = newfollow + regulator.get(element, element) follow = newfollow return follow if startpos is not None: self.moveTo(startpos) if startdeg is not None: self.turnTo(startdeg) self.step, self.angle = walked, angle design = replace(axiom, regulator, deep) for b in design: try: regulate[b]() except KeyError: pass _________________________________________________________________ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail From urnerk@qwest.net Wed Jul 9 16:08:17 2003 From: urnerk@qwest.net (Kirby Urner) Date: Wed, 09 Jul 2003 08:08:17 -0700 Subject: [Edu-sig] re: A small essay in my own defense In-Reply-To: <000501c3461e$794df060$1a02a8c0@BasementDell> Message-ID: <5.2.0.9.0.20030709080421.01c68d18@pop.ptld.qwest.net> At 08:31 AM 7/9/2003 -0500, Arthur wrote: >Kirby writes - > > >CP4E is clever enough as a *direction*. I like to say that knowing > >something about programming is like knowing something about internal > >combustion engines. Yet we're not all mechanics. It's just helpful > >to know "how things work". > >To me, the question than becomes one of semantics. How far down the road >toward a redefinition of the word "programming" are we allowing ourselves to >go. Well, when you go to a play they hand you a "program" and the thing actors work from is called a "script". What you see on stage is the execution. That's how far, or not far at all (back to the semantic roots: all the world's a stage, and all the men and women merely objects). Kirby >BIG ISSUE, in my book. > >BIG, BIG ISSUE. > >Did I metion I think the issue is significant? > >Art > > >_______________________________________________ >Edu-sig mailing list >Edu-sig@python.org >http://mail.python.org/mailman/listinfo/edu-sig From urnerk@qwest.net Wed Jul 9 16:17:20 2003 From: urnerk@qwest.net (Kirby Urner) Date: Wed, 09 Jul 2003 08:17:20 -0700 Subject: [Edu-sig] re: A small essay in my own defense In-Reply-To: <000501c34623$2e557ce0$1a02a8c0@BasementDell> Message-ID: <5.2.0.9.0.20030709080930.01ce1fe8@pop.ptld.qwest.net> At 09:05 AM 7/9/2003 -0500, Arthur wrote: > >To me, the question than becomes one of semantics. >How far down the road >toward a redefinition of the >word "programming" are we allowing ourselves >to go > >Which is also, I think, related to a sense of responsibility to a larger >community - where I guess my first loyalties lie. > >I have no interest in provoking, for example, the DrScheme people to murder >by competing with their substantial efforts by playing with semantics. > >As we are defining "programming", is the claim made on the edu-sig page that >CP4E is simply a different approach to accomplishing what the DrScheme folks >are trying to accomplish, defensible. > >I have substantial doubt.. So I wonder how the DrScheme folks might feel. > >As far as I am concnerned, the DrScheme folks have shown great restraint. > >I would hate to have to "go back to Russia" myself, and defend them, should >they decide to no longer hold their fire. > >Art Not sure I follow. For me, its a diffusion issue. Just about any device from a vending machine to a cell phone to a bank to an airplane has embedded software. You used to be able to explain the world without reference to code. Now you can't. It's ubiquitous. So from a "how things work" point of view (a "get to know your world" point of view) it's necessary to have some idea of what code does and how it comes into existence. To that end, we create learning experiences around coding, since just reading about programming is not as interesting or eye-opening as really doing some yourself. It's like in art class: we look at the great paintings and sculptures of the world, then go to the studio and slap some paint and clay around. Doesn't mean we're all making a career out of it. But we get some clear impressions, and many who wouldn't have considered a career in clay, will now do so, cuz it turns out they love it. In lots of jobs, there's some relationship with code that doesn't involve one being a full-time or professional coder. Part of basic numeracy these days is having some familiarity with code and coding, even if it's just to stand around the water cooler to talk about "wrapping legacy data in some platform neutral OO language" (and whattabout them Red Sox). Kirby From Jason Cunliffe" Message-ID: <000b01c34635$c8eb9840$6401a8c0@ValuedSonyCustomer> > Well, when you go to a play they hand you a "program" and the thing > actors work from is called a "script". What you see on stage is the > execution. > > That's how far, or not far at all (back to the semantic roots: all > the world's a stage, and all the men and women merely objects). Yes and thus almost all TV 'programs' and Films are based on scripts. --=Jason From ajs@ix.netcom.com Wed Jul 9 18:09:27 2003 From: ajs@ix.netcom.com (Arthur) Date: Wed, 9 Jul 2003 13:09:27 -0400 (EDT) Subject: [Edu-sig] re: A small essay in my own defense Message-ID: <1043622.1057782717791.JavaMail.nobody@louie.psp.pas.earthlink.net> Kirby writes - >Not sure I follow. snip >So from a "how things work" point of view (a "get to know your >world"point of view) it's necessary to have some idea of what >code does and how it comes into existence. As sometimes happens, I can not follow why you are not following what I think is a clear argument. You can define "programming" anyway you want,I guess. And you can certainly reasonably argue that something *about* programming sensibly belongs in a curriculum. Just be sensitive to the fact that others may be using that exact same word to mean something quite else: a rigorous approach to a rigorous discipline. Applied mathematics of an advanced nature. Naked, as such. We both teach "programming". But they just make it seem so hard. We give easy A's over here. That's one way to fill up a class. Art Please understand I am not being critical of anything you are saying, other than to suggest - lets talk about apples when we are talking apples, and oranges when meaning oranges. And bend, especially, over backward to do so, when it is to some tactical advantage to do otherwise. I think the Open Source ethic holds us to high standards - or should - in respect to these kinds of things. Art From arkamir@softhome.net Wed Jul 9 22:05:19 2003 From: arkamir@softhome.net (Conrad Koziol) Date: 09 Jul 2003 14:05:19 -0700 Subject: [Edu-sig] Re: Edu-sig digest, Vol 1 #721 - 8 msgs In-Reply-To: <20030709160005.21099.42065.Mailman@mail.python.org> References: <20030709160005.21099.42065.Mailman@mail.python.org> Message-ID: <1057784719.4886.4.camel@quercus.home.net> >What the greatest teaching tool ever for me would a >python tutorial on how to build a message board/forum. I strongly suspect that such a tutorials already exists. In the form of working programs, which you can take apart, and analyze, and break, and then fix, and change, and break again, and fix again. I have searched for a while and the only one I could find is TPF http://gorny.cjb.net The problem is its note even commented From ajs@optonline.net Thu Jul 10 01:29:31 2003 From: ajs@optonline.net (Arthur) Date: Wed, 09 Jul 2003 19:29:31 -0500 Subject: [Edu-sig] re: Student teaching and tutorials Message-ID: <001b01c3467a$5575be00$1a02a8c0@BasementDell> >I have searched for a while and the only one I could find >is TPF http://gorny.cjb.net The problem is its note even >commented Took a quick look. Introduction Billy the Kid is a Python Extension Module providing you with all kinds of more or less usefull stuff at the raw packet level. It allows you to create raw UDP/TCP/ICMP packets and it also includes a nice interface to libpcap. The author is 18 years old. Conrad, If you understand what this (snotty kid ;) ) just said - you are way ahead of me. So I am certainly not the right guy to be advising you on networking stuff. But I do understand that this is an extension module for Python, written in C. Not in Python. So please don't be intimidated by what you are seeing. C is not for me. But Lee's working demo of pygame in multi-player mode using Twisted - part of pygear - is where I intend to start - when I get around to tackling networking with Python. (And Lee thinks he's writing for kids). So the advise I gave you, is the advise I am giving myself. Lee seems to be looking for feedback. Might be more meaningful from you, then from someone like me. Have you taken a look? Does it seem to suit your needs, as a way to get started in writing working code. I sometimes think about learning how the pieces move, but then learning how to *play chess*. You want to start playing some chess, so to speak. I think Lee's book understands that. If indeed you are already beyond what Lee is teaching you might dig into the Twisted demos directly, perhaps. http://twistedmatrix.com/ Twisted looks *extremely* well documented Art From Jason Cunliffe" <1057784719.4886.4.camel@quercus.home.net> Message-ID: <000b01c34672$d65f6d20$6401a8c0@ValuedSonyCustomer> > I have searched for a while and the only one I could find is TPF > http://gorny.cjb.net > The problem is its note even commented hmm.. Yeah I searched on Parnassus quickly but I can't see anything there other than what you already found Tiny Python Forum 0.2 - Simple CGI script written in Python http://home.student.utwente.nl/g.v.berg/misc/tpf-0.2.tar.gz The code is not commented but looks reasonable at a quick glance.. The README file which the author includes has some simple instructions to installing and using it. Have you tried it yet? If you get it set up an running then start tweaking a few things as he suggests and grow from there. I am not clear at what level you want to learn. There are a number of books and sites which discuss general web programming concepts and protocols. Until I gained some of that understanding, I found many web programming packages incomprehensible, with or without docs and tutorials. I simply did not understand enough about how Internet and web protocols worked. And I remember looking through the source, I could not distinguish the Python programming language stuff from the web-specific code it was manipulating. It was exhausting. Looked in Python's own docs and saw HTTP server and more goodies. But I didn't know CGI or http so could not follow the text well or put them to use sensibly. Then I found a great book which helped me HTTP Essentials: Protocols for Secure, Scaleable Web Sites by Stephen A. Thomas [under $20 2nd hand] http://www.amazon.com/exec/obidos/tg/stores/offering/list/-/0471398233/all/r ef=dp_pb_a/103-2698402-8575801 Another incredibly useful book you might want to invest in is the O'Reilly "Python Cookbook" Edited by Alex Martelli & David Ascher. Some of the best Python projects are frameworks which offer high level access to complex features. Designed to save work for other programmers. For example, intense web tools like Webware or Zope which might do a what you want immediately and professionally. But they could well not teach you directly what you want to learn, because they are so too powerful, vast and sophisticated already. But a big part of programming in Python is about learning using how to use other people's code. It is one of the essential skills. But Art's comment along the lines of 'you don't need tutorials, just experience and other people's source' - simply does not acknowledge the overwhelming aspects at some stages in one's development. Python has an abundance of riches. But sometimes gently learning a core technique or how to a do a small simple task is obscured. Using other peoples' code intelligently does not necessarily mean you have to read or understand all [or even any] of it. Debugging an error does not mean one should or can understand the structure of a complex program. You follow the errors like arrows. One of the most important things which Tutorials do is provide a map of the most important features and structure in a meaningful sequence. Reading most source code will not give one that unless it is well written and beautifully documented. But some people develop amazing skill to study source code. Like poetry I wonder what can anyone else do to help one understand it. Hearing a poet read their own work is often [but not always] enlightening. I've had the privilege to sit next to a few good programmer friends as they talk/walk their way through some code they had written. As much as private study and hands-on *trying* is valuable, I learn something incredibly important in those sessions - how to approach reading and thinking about code. Which were the 'interesting' or clever bits, along with the trivial or boring parts And from there then how to discuss it and understand how to build a program. There is revolution being ushered in with instant messaging and presence which will open up code for live study and remote active collaboration. Imagine if IDLE had a group 'buddylist' you could use to share and browse with others. It will before too long I am sure. I am not advocating a passive approach. But being able to watch someone craft a program, to see how it grows or how it gets commented and turns from pseudo- code into the real debugged thing would be incredibly useful. For teachers and students, peers and reviewers. "All Software Should Be Network Aware" http://www.oreillynet.com/pub/wlg/3422 hth + good luck Jason From ajs@optonline.net Thu Jul 10 04:01:38 2003 From: ajs@optonline.net (Arthur) Date: Wed, 09 Jul 2003 22:01:38 -0500 Subject: [Edu-sig] Re: Edu-sig digest, Vol 1 #721 - 8 msgs Message-ID: <000501c3468f$95622250$1c02a8c0@BasementDell> Jason writes - >But Art's comment along the lines of 'you don't need tutorials, just >experience and other people's source' - simply does not acknowledge the >overwhelming aspects at some stages in one's development. Python has an >abundance of riches. But sometimes gently learning a core technique or how >to a do a small simple task is obscured. Maybe I was being a little too poetic myself. The specific advice I gave and give was to work within the structure that Lee Harr's book provides, and to use it in exactly the way that Lee recommends. My point about the tutorial already being there was - a message board is a complex piece of software. And if one waits until someone should write the perfect tutorial for writing message board software, one will probably just be waiting. If you break down the task, or knowledgebase - and attack it bit by bit, by finding the right tutorial or source to explore for each bit, one can start to make progress. And keep moving forward. Attempting to swallow a piece of message board software whole - I think we are agreeing - is too big of a meal. And I am being serious in thinking about whether the skills involved in learning how to attack a problem like this - let's assume the message board tutorial, as a stand-alone piece of work does not exist - is something that can be tutorialized. Why do you find things on the web that I don't? I am sure we are using the same tools. You seem to have a more intuitive sense of how to search. Is that something you could teach? Probably, to some degree. I think I am a fairly skilled brain picker. Some learned skill, and some intuitive sense of how to break down a problem into its constituent parts, and go at them one at a time, finding resources that I have the prerequisites to understand, or taking a step back and at least understanding what prerequisite I am missing, and making the turn to fill that prerequisite. Is it something I can try to communicate as a tutorial? Not sure. Art From urnerk@qwest.net Thu Jul 10 15:15:24 2003 From: urnerk@qwest.net (Kirby Urner) Date: Thu, 10 Jul 2003 07:15:24 -0700 Subject: [Edu-sig] Student teaching and tutorials In-Reply-To: <1057681598.4882.31.camel@quercus.home.net> References: <20030708072301.20684.53375.Mailman@mail.python.org> <20030708072301.20684.53375.Mailman@mail.python.org> Message-ID: <5.2.0.9.0.20030710071032.0201ea70@pop.ptld.qwest.net> At 09:26 AM 7/8/2003 -0700, Conrad Koziol wrote: >They don't seem to develop it much further. I quickly understand lists >and stuff and then they jump into class and control flow which is more >complicated. What the greatest teaching tool ever for me would a python >tutorial on how to build a message board/forum. This would include >everything from lists to classes to htmlgen. There's something like this in 'Python: How to Program' (Deitel). It's XML based, using Python. It presumes you have a web server (e.g. Apache) available, and are using Python as your cgi language. Very simple message board. The book itself is fairly spendy (like $85). I see Amazon has some used: http://www.amazon.com/exec/obidos/tg/detail/-/0130923613/ I worked as one of the technical reviewers on this one. One of my complaints was that several chapters have little to do with Python. That's because it's part of a series across several languages and some of the stuff they just recycle. Kirby From arkamir@softhome.net Thu Jul 10 18:30:26 2003 From: arkamir@softhome.net (Conrad Koziol) Date: 10 Jul 2003 10:30:26 -0700 Subject: [Edu-sig] Re: Edu-sig digest, Vol 1 #722 - 7 msgs In-Reply-To: <20030710160003.30993.68457.Mailman@mail.python.org> References: <20030710160003.30993.68457.Mailman@mail.python.org> Message-ID: <1057858226.4886.18.camel@quercus.home.net> > > Took a quick look. > Introduction > Billy the Kid is a Python Extension Module providing you with all kinds of > more or less usefull stuff at the raw packet level. It allows you to create > raw UDP/TCP/ICMP packets and it also includes a nice interface to libpcap. > > > The author is 18 years old. > I apoligize Art but I seem to have pointed you in the wrong direction. That was the website provided in the package. I didn't bother to check it out since I though it was the link to download the package again. http://home.student.utwente.nl/g.v.berg/misc/tpf-0.2.tar.gz This is were it can be downloaded and there is a link to it off the Vaults of Parnassus Thanks From arkamir@softhome.net Thu Jul 10 18:38:43 2003 From: arkamir@softhome.net (Conrad Koziol) Date: 10 Jul 2003 10:38:43 -0700 Subject: [Edu-sig] Lees book In-Reply-To: <20030710160003.30993.68457.Mailman@mail.python.org> References: <20030710160003.30993.68457.Mailman@mail.python.org> Message-ID: <1057858723.4886.25.camel@quercus.home.net> Hey thanks for the advice I'm currently going through his book. Seems like a fun way to learn. Also any advice on learning about the logic of python such as using passing a list through len to get the indexs. I understand basic logic, but since this is my first real language, I'm running into some problems From missive@hotmail.com Fri Jul 11 05:07:56 2003 From: missive@hotmail.com (Lee Harr) Date: Fri, 11 Jul 2003 04:07:56 +0000 Subject: [Edu-sig] Re: Lees book Message-ID: >Hey thanks for the advice I'm currently going through his book. Seems >like a fun way to learn. Also any advice on learning about the logic of >python such as using passing a list through len to get the indexs. I >understand basic logic, but since this is my first real language, I'm >running into some problems If you start getting in to it, and you enjoy it, you will definitely want to look at more documentation (like the official python docs at http://python.org/doc/) You will probably also want to join a more code-focused list like (usenet) comp.lang.python or tutor@python.org _________________________________________________________________ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail From urnerk@qwest.net Fri Jul 11 08:26:33 2003 From: urnerk@qwest.net (Kirby Urner) Date: Fri, 11 Jul 2003 00:26:33 -0700 Subject: [Edu-sig] Lees book In-Reply-To: <1057858723.4886.25.camel@quercus.home.net> References: <20030710160003.30993.68457.Mailman@mail.python.org> <20030710160003.30993.68457.Mailman@mail.python.org> Message-ID: <5.2.0.9.0.20030711002034.01c45008@pop.ptld.qwest.net> At 10:38 AM 7/10/2003 -0700, Conrad Koziol wrote: >Hey thanks for the advice I'm currently going through his book. Seems >like a fun way to learn. Also any advice on learning about the logic of >python such as using passing a list through len to get the indexs. I >understand basic logic, but since this is my first real language, I'm >running into some problems Feel free to post a code example of what you're trying to do. You can use a list's index method to return the position of one of its members (elements). >>> ['x','joe','r'].index('joe') 1 Kirby From urnerk@qwest.net Fri Jul 11 08:44:28 2003 From: urnerk@qwest.net (Kirby Urner) Date: Fri, 11 Jul 2003 00:44:28 -0700 Subject: [Edu-sig] re: A small essay in my own defense In-Reply-To: <1043622.1057782717791.JavaMail.nobody@louie.psp.pas.earthl ink.net> Message-ID: <5.2.0.9.0.20030711002931.01effe00@pop.ptld.qwest.net> At 01:09 PM 7/9/2003 -0400, you wrote: >As sometimes happens, I can not follow why you are not following what >I think is a clear argument. I didn't know what you meant about the Scheme people showing restraint nor what you meant by "hating to 'go back to Russia'". >You can define "programming" anyway you want,I guess. And you can certainly >reasonably argue that something *about* programming sensibly belongs in a >curriculum. And 'about' isn't good enough -- should involve some hands-on experience. >Just be sensitive to the fact that others may be using that exact same >word to mean something quite else: a rigorous approach to a rigorous >discipline. Applied mathematics of an advanced nature. Naked, as such. Not mutually exclusive. My analogy was with slapping clay around in art class -- but with examples of great masterworks available. It's not like I'm saying we should forget about the hallmarks of quality work. But there's no point just being intimidating. The first step is to make it fun and accessible. Then we can start showing examples of how *not* to code (but give examples of the right way first). >We both teach "programming". But they just make it seem so hard. We >give easy A's over here. Who are "they"? The Scheme people? >That's one way to fill up a class. > >Art > > >Please understand I am not being critical of anything you are saying, >other than to suggest - lets talk about apples when we are talking >apples, and oranges when meaning oranges. I guess the differences needn't hinge on how we define programming. Let's talk instead about what the *goal* of writing a program might be, in specific cases. If it's to write something robust and maintainable, and to send it out into the world, that's one thing. If it's to quickly throw something together for private use, in order to gain understanding of a concept (perhaps not specific to programming), that's something else. Both are valid goals, and I can easily think of many others, just as I'm sure you can. >And bend, especially, over backward to do so, when it is to some >tactical advantage to do otherwise. > >I think the Open Source ethic holds us to high standards - or should - >in respect to these kinds of things. > >Art Yes, Open Source by its nature promotes better coding, because you know that others will be studying your source, not just the outward runtime interface (which might look pretty, but be junk underneath -- a fact not easily hidden if the source is in plain view). Open source ethics make it harder to BS. As someone was pointing out this evening at OSCON, it's a different kind of job interview when you can say "just look at my source code, if you want to know what I'm capable of". And the interviewer can ask if you have check-in privileges on CVS (if you claim to be deeply involved in some group coding effort). Kirby From ajs@optonline.net Fri Jul 11 13:55:26 2003 From: ajs@optonline.net (Arthur) Date: Fri, 11 Jul 2003 07:55:26 -0500 Subject: [Edu-sig] re: A small essay in my own defense Message-ID: <000501c347ab$b3d29d10$1c02a8c0@BasementDell> >I didn't know what you meant about the Scheme people >showing restra= int nor what you meant by "hating to 'go >back to Russia'". Yeah. I guess I do talk in riddles, sometimes. But I *am* saying something rather harsh, and it is difficult to say = - in so many words. =46rom the edu-sig page - >TeachScheme! >A similar project using Scheme instead of Python; they >have 5 years= of experience doing similar things. Really don't want to beat this horse, though. But I am, who I am, so I shall. And suggest that under your definition/concept of CP4E, which is abou= t as good a concept/definition as I might imagine, the statement that it i= s a "similar project" to TeachScheme, is a mischaracter=B7i=B7zation of T= eachScheme. CP4E is a slogan and some concepts. What actual resources does it inc= lude? I get to that. TeachScheme is a comprehensive set of organized resources developed methodically over a number of years - representing a developed approa= ch to the introduction of programming, and a comprehensive set of organized resources for doing so. How effective it is or isn't - not being the= point. I don't know. Not having gone through the program. And it is free and Open Source, and the advocacy of the use of Python= as an introductory programming language is in direct competition with it. Saying that CP4E is a "similar project" cannot be supported. Sloppine= ss of this sort is bad, when it is self-serving. If we put together the best available resources for using Python in education - and there are many good resources - it may be possible to= say there are resources out there that can rival TeachScheme. But those resources are individual efforts. And most could not be classified t= o exist under the CP4E banner, because they are outside of the CP4E concept o= f being accessible to "everybody" - and certainly their creators may not hav= e not signed off on having their effort as considered within the CP4E "fram= ework". Is everything of an educational nature written in or about Python par= t of CP4E? Who said? How does one get off that bus? If it is that which grew out of the original CP4E proposal than it is= IDLE, perhaps, and only IDLE. Do you want to defend the notion that IDLE i= s "similar" to TeachScheme? I don't. I'll rather go back to Russia. (I guess that's from my chil= dhood. My family and many of the families around us had Eastern European roo= ts. In the heat of political battle you might tell someone to your Left - a= nd therefore less of a patriot then oneself - to go back to Russia. But = you were probably saying it to some Aunt that you loved (and would hate t= o see go back to Russia), or some Nephew, who had nver been there. Not to = be taken too seriously, in other words. Art From urnerk@qwest.net Fri Jul 11 15:59:49 2003 From: urnerk@qwest.net (Kirby Urner) Date: Fri, 11 Jul 2003 07:59:49 -0700 Subject: [Edu-sig] re: A small essay in my own defense In-Reply-To: <000501c347ab$b3d29d10$1c02a8c0@BasementDell> Message-ID: <5.2.0.9.0.20030711073558.01e99818@pop.ptld.qwest.net> OK, thanks for spelling it out like that. Much better. And yes, I see your point. It hadn't really occurred to me that comparing CP4E to TeachScheme was an implicit claim that our materials were as evolved, or the outreach so organized, which clearly is not the case. I think the intent was more to say something like "here's a mature and established implementation that inspires us by example -- and yes, by comparison we've still got a long way to go". Emulation is the sincerest form of flattery and all that. I'll think about changing the wording a bit (I don't recall whether I had input into the phrasing used now, but it doesn't matter). Clearly there's a lot of work needed on the edu-sig page. Indeed, the entire website needs to be revamped, an effort that should get more attention now that OSCON is winding down (today's the last day). Kirby From guido@python.org Fri Jul 11 17:28:20 2003 From: guido@python.org (Guido van Rossum) Date: Fri, 11 Jul 2003 12:28:20 -0400 Subject: [Edu-sig] re: A small essay in my own defense In-Reply-To: Your message of "Fri, 11 Jul 2003 07:55:26 CDT." <000501c347ab$b3d29d10$1c02a8c0@BasementDell> References: <000501c347ab$b3d29d10$1c02a8c0@BasementDell> Message-ID: <200307111628.h6BGSKY03172@pcp02138704pcs.reston01.va.comcast.net> > Is everything of an educational nature written in or about Python part of > CP4E? Who said? Yes: everything that makes Python more usable in education (of whatever kind) helps towards the ultimate goal of CP4E. That includes PyGeo (of which Google says: "Did you mean: *pigeon*" :-). --Guido van Rossum (home page: http://www.python.org/~guido/) From ajsiegel@optonline.net Fri Jul 11 18:45:12 2003 From: ajsiegel@optonline.net (ajsiegel@optonline.net) Date: Fri, 11 Jul 2003 13:45:12 -0400 Subject: [Edu-sig] re: A small essay in my own defense Message-ID: <2f108314f6.314f62f108@optonline.net> >(of which Google says: "Did you mean: *pigeon*" :-). The Pigeon of course being the Python's favorite delicacy. (Another baseless fact, brought to you by Art :) ) Art From ajsiegel@optonline.net Sun Jul 13 16:29:00 2003 From: ajsiegel@optonline.net (Arthur) Date: Sun, 13 Jul 2003 11:29:00 -0400 Subject: [Edu-sig] Old News Message-ID: <000701c34953$7c86ad20$0c02a8c0@Arts> Apparently this is widely circulated. I just came across it. http://mars.jpl.nasa.gov/msp98/news/mco990930.html Sept. 30, 1999 MARS CLIMATE ORBITER TEAM FINDS LIKELY CAUSE OF LOSS The peer review preliminary findings indicate that one team used English units (e.g., inches, feet and pounds) while the other used metric units for a key spacecraft operation. This information was critical to the maneuvers required to place the spacecraft in the proper Mars orbit Ouch. In law school (IANAL, btw) the cautionary tale is of the misplaced comma subverting the intended meaning of a contract. Good tales to be told, IMO. Art From urnerk@qwest.net Thu Jul 17 00:41:33 2003 From: urnerk@qwest.net (Kirby Urner) Date: Wed, 16 Jul 2003 16:41:33 -0700 Subject: [Edu-sig] OSCON presentations available In-Reply-To: <000701c34953$7c86ad20$0c02a8c0@Arts> Message-ID: <5.2.0.9.0.20030716162905.01a2aa40@pop.ptld.qwest.net> Check out the downloadable slide presentations at http://conferences.oreillynet.com/pub/w/23/presentations.html My 'Python in Education' is listed but they screwed up the URL (I asked for a fix, but so far no dice) -- either change urner_kirby.final.ppt to urner_kirby_final.ppt after clicking on the bogus link, or grab a copy from one of my own sites: http://www.inetarena.com/~pdx4d/ocn/python/oscon2003/ (along with the tiny source code module, if interested). It's a 3 meg powerpoint, but should be viewable in Open Office. I got a lot of good feedback on my talk. Many positive remarks and some follow-up contacts. Kirby PS: if anyone finds a link to George Dyson's excellent slides, please let me know. I talked to him after and he said he was working on getting his slides on "Tim's website" meaning Tim O'Reilly -- I assume that means somewhere in the OSCON pages, but so far I can't find it. His keynote re Von Neumann's Universe: Coding (and Engineering) at the IAS, 1945-1956 included a lot of hard-to-find raw historical documents. http://conferences.oreillynet.com/cs/os2003/view/e_sess/4375 From Jason Cunliffe" Message-ID: <000701c34bf9$1aa3fb00$6401a8c0@ValuedSonyCustomer> > Check out the downloadable slide presentations at > http://conferences.oreillynet.com/pub/w/23/presentations.html Thanks -- Looks like good stuff. Hopefully before too much longer these conference presentations will all be viewable on DVDs and/or online as streaming video too. I love the baby giving the Python a bath :-) Where did you find that ? - Jason From urnerk@qwest.net Thu Jul 17 03:30:56 2003 From: urnerk@qwest.net (Kirby Urner) Date: Wed, 16 Jul 2003 19:30:56 -0700 Subject: [Edu-sig] OSCON presentations available In-Reply-To: <000701c34bf9$1aa3fb00$6401a8c0@ValuedSonyCustomer> References: <5.2.0.9.0.20030716162905.01a2aa40@pop.ptld.qwest.net> Message-ID: <5.2.0.9.0.20030716192646.035e75a0@pop.ptld.qwest.net> At 08:19 PM 7/16/2003 -0400, Jason Cunliffe wrote: > > Check out the downloadable slide presentations at > > http://conferences.oreillynet.com/pub/w/23/presentations.html > >Thanks -- Looks like good stuff. Hooray, O'Reilly fixed the link. Now I don't have to give these convoluted instructions. >Hopefully before too much longer these conference presentations will all be >viewable on DVDs and/or online as streaming video too. Yeah, although they're still going to want to reserve the highest bandwidth access to the paying customers -- as long as there's a "meat space" venue (in this case the Marriott in downtown Portland -- very convenient. >I love the baby giving the Python a bath :-) >Where did you find that ? > >- Jason I believe it's a picture from Thailand but I don't know the source (or I'd have given one). A guy who attended an earlier draft of my presentation (I had two test audiences -- made my final talk a lot smoother), and emailed it to me later. Kirby From ajs@optonline.net Thu Jul 17 14:08:59 2003 From: ajs@optonline.net (Arthur) Date: Thu, 17 Jul 2003 08:08:59 -0500 Subject: [Edu-sig] OSCON presentations available Message-ID: <000701c34c64$96cb6ae0$1a02a8c0@BasementDell> > http://www.inetarena.com/~pdx4d/ocn/python/oscon2003/ wow. Good stuff. Nice to see your work and thought process brought together as a whole, in presentation form. Art From rlatimer@tjhsst.edu Thu Jul 17 17:09:55 2003 From: rlatimer@tjhsst.edu (Randy Latimer) Date: Thu, 17 Jul 2003 12:09:55 -0400 (EDT) Subject: [Edu-sig] OSCON presentations available In-Reply-To: <5.2.0.9.0.20030716162905.01a2aa40@pop.ptld.qwest.net> Message-ID: Thanks for the Python in Ed slides. I teach in a magnet high school for science and tech, we're fortunate to have received a Cray SV1 supercomputer last year. We have a "Supercomputer Applications" course, and we're looking for project ideas in high performance computing - distributed computing and parallel processing (we've started looking at MPI - Message Passing Interface using C/C++) Let me know if anyone out there has high performance computer modeling applications that could be interesting to high schoolers. We have a networked lab of Debian Linux workstations and the Cray. Also we have a Mosix cluster of 16 computers, several years old. Thanks, Randy Latimer rlatimer@tjhsst.edu or Randy.Latimer@fcps.edu On Wed, 16 Jul 2003, Kirby Urner wrote: > > Check out the downloadable slide presentations at > http://conferences.oreillynet.com/pub/w/23/presentations.html > > My 'Python in Education' is listed but they screwed up > the URL (I asked for a fix, but so far no dice) -- either > change urner_kirby.final.ppt to urner_kirby_final.ppt > after clicking on the bogus link, or grab a copy from > one of my own sites: > http://www.inetarena.com/~pdx4d/ocn/python/oscon2003/ > (along with the tiny source code module, if interested). > It's a 3 meg powerpoint, but should be viewable in Open > Office. > > I got a lot of good feedback on my talk. Many positive > remarks and some follow-up contacts. > > Kirby > > PS: if anyone finds a link to George Dyson's excellent > slides, please let me know. I talked to him after and he > said he was working on getting his slides on "Tim's > website" meaning Tim O'Reilly -- I assume that means > somewhere in the OSCON pages, but so far I can't find > it. His keynote re Von Neumann's Universe: Coding (and > Engineering) at the IAS, 1945-1956 included a lot of > hard-to-find raw historical documents. > http://conferences.oreillynet.com/cs/os2003/view/e_sess/4375 > > > > > _______________________________________________ > Edu-sig mailing list > Edu-sig@python.org > http://mail.python.org/mailman/listinfo/edu-sig > From ajs@ix.netcom.com Thu Jul 17 19:44:30 2003 From: ajs@ix.netcom.com (Arthur) Date: Thu, 17 Jul 2003 14:44:30 -0400 (EDT) Subject: [Edu-sig] re: OSCON presentations available Message-ID: <4326962.1058478304992.JavaMail.nobody@rowlf.psp.pas.earthlink.net> >Let me know if anyone out there has high performance computer >modeling >applications that could be interesting to high schoolers. >We have a networked lab of Debian Linux workstations and the >Cray. >Also we have a Mosix cluster of 16 computers, several years old. Renderfarm? Blender, using Python http://www.linuxartist.org/article.php?sid=224 Maybe? Art From eee@nmt.edu Thu Jul 17 23:27:44 2003 From: eee@nmt.edu (Earl) Date: Thu, 17 Jul 2003 16:27:44 -0600 Subject: [Edu-sig] os.fork() in python for windows. Message-ID: <3F1722E0.6050103@nmt.edu> I recently installed python2_2_3 on Windows 2000. When I call os.fork() I get the error messaage "'module' object has no attribute 'fork'". How do I spawn a new process? Earl Eiland From urnerk@qwest.net Fri Jul 18 02:15:26 2003 From: urnerk@qwest.net (Kirby Urner) Date: Thu, 17 Jul 2003 18:15:26 -0700 Subject: [Edu-sig] os.fork() in python for windows. In-Reply-To: <3F1722E0.6050103@nmt.edu> Message-ID: <5.2.0.9.0.20030717181358.0175c100@pop.ptld.qwest.net> At 04:27 PM 7/17/2003 -0600, Earl wrote: >I recently installed python2_2_3 on Windows 2000. When I call os.fork() I >get the error messaage "'module' object has no attribute 'fork'". > >How do I spawn a new process? > >Earl Eiland > > >_______________________________________________ >Edu-sig mailing list >Edu-sig@python.org >http://mail.python.org/mailman/listinfo/edu-sig Check out the popen commands? They're in os. Kirby From ajs@optonline.net Fri Jul 18 15:30:54 2003 From: ajs@optonline.net (Arthur) Date: Fri, 18 Jul 2003 09:30:54 -0500 Subject: [Edu-sig] re: TeachScheme Message-ID: <000501c34d39$32d74830$1a02a8c0@BasementDell> http://www.cs.utah.edu/plt/mailarch/plt-scheme-2000/msg00676.html Thought I would do a little google to test my theory about whether the TeachScheme guys feel abused. My intuition gets (another) A+ grade. Anybody can feel abused about anything. The question is to what extent they have a legimate case. You know my feelings. How do we go about being less subject to this kind of criticism, to the extent it is righteous criticism? It really is a question. In that I have no specific answers. """ You might want to compare the Python-in-education movement against the TeachScheme! project. Software vs vaporware; full programming environment vs low-level interaction; detailed curriculum vs ad hoc programming; intellectual depth vs shallow hacking; five years vs nothing but announcements. You can guess which one is which. And consider the harm done when people parrot the hype. """ Shriram Krishnamurthi From urnerk@qwest.net Fri Jul 18 15:59:32 2003 From: urnerk@qwest.net (Kirby Urner) Date: Fri, 18 Jul 2003 07:59:32 -0700 Subject: [Edu-sig] re: TeachScheme In-Reply-To: <000501c34d39$32d74830$1a02a8c0@BasementDell> Message-ID: <5.2.0.9.0.20030718075257.01f04708@pop.ptld.qwest.net> At 09:30 AM 7/18/2003 -0500, Arthur wrote: >""" >You might want to compare the Python-in-education movement against the >TeachScheme! project. Software vs vaporware; full programming >environment vs low-level interaction; detailed curriculum vs ad hoc >programming; intellectual depth vs shallow hacking; five years vs >nothing but announcements. > >You can guess which one is which. And consider the harm done when >people parrot the hype. >""" >Shriram Krishnamurthi Yeah, he's been the most vocal anti-Python exponent (we've corresponded in the past). My attitude is grow the pie -- programming in education means more room for all comers. I don't find the PLT Scheme "full programming environment" to be all that super advanced over whatever he means by "low-level interaction". Maybe he hasn't seen Patrick's namespace aware PyAlaMode. Kirby From ajs@optonline.net Fri Jul 18 17:34:14 2003 From: ajs@optonline.net (Arthur) Date: Fri, 18 Jul 2003 11:34:14 -0500 Subject: [Edu-sig] re: TeachScheme Message-ID: <000701c34d4a$6d65e9a0$1a02a8c0@BasementDell> >I don't find the PLT Scheme "full programming >environment" to be all that super advanced over >whatever he means by "low-level interaction". >Maybe he hasn't seen Patrick's namespace aware >PyAlaMode. I agree that is the weakest link in his argument. As I have said here before - and therfore to Mathias's - it is that environment that stopped in my tracks when I took at a shot at TeachScheme. But also as I've said here, it was the focus on "environment" itself, rather than that *particular* environement that happened to be my problem. I am not alone in feeling that beginning programming is best approached in an as "environmentless" environment as possible. When I didn't see an easy way to get at Scheme, outside of the imposed environment, I moved on. But in fairness, I was learning on my own. Which is not the audience of TeachScheme. In the context of their integrated curricula, it might make perfect sense. And certainly you/we cannot get off the hook that easily - by pointing to the weakest link in his argument. And labeling him as "anti-Python", is a diversion. I wish this was only a *language* war. It is, IMO, something deeper and more significant than that. And I am not quite sure that God is fully on our side. Art From urnerk@qwest.net Fri Jul 18 19:31:40 2003 From: urnerk@qwest.net (Kirby Urner) Date: Fri, 18 Jul 2003 11:31:40 -0700 Subject: [Edu-sig] re: TeachScheme In-Reply-To: <000701c34d4a$6d65e9a0$1a02a8c0@BasementDell> Message-ID: <5.2.0.9.0.20030718111439.02456898@pop.ptld.qwest.net> At 11:34 AM 7/18/2003 -0500, Arthur wrote: >And labeling him as "anti-Python", is a diversion. Well, I've heard him disparage Python in other contexts where education wasn't the topic. It's an accurate representation, whether a diversion or not. >I wish this was only a *language* war. > >It is, IMO, something deeper and more significant than that. And I am not >quite sure that God is fully on our side. > >Art I've removed the link to TeachScheme from the latest edu-sig, so as not to imply any comparison -- why link to Scheme in particular and not other languages that push out to the schools? Kirby From urnerk@qwest.net Fri Jul 18 19:37:32 2003 From: urnerk@qwest.net (Kirby Urner) Date: Fri, 18 Jul 2003 11:37:32 -0700 Subject: [Edu-sig] edu-sig page revamped In-Reply-To: <5.2.0.9.0.20030718075257.01f04708@pop.ptld.qwest.net> References: <000501c34d39$32d74830$1a02a8c0@BasementDell> Message-ID: <5.2.0.9.0.20030718113332.02592ea0@pop.ptld.qwest.net> I've just finished a long-overdue revamp of http://www.python.org/sigs/edu-sig I think it's more up to date and relevant to educators as a result. I'll expand it soon to include more links to code repositories such as Vaults, Useless and ActiveState's. Feedback welcome. Kirby From urnerk@qwest.net Fri Jul 18 19:47:29 2003 From: urnerk@qwest.net (Kirby Urner) Date: Fri, 18 Jul 2003 11:47:29 -0700 Subject: [Edu-sig] edu-sig page revamped In-Reply-To: <5.2.0.9.0.20030718113332.02592ea0@pop.ptld.qwest.net> References: <5.2.0.9.0.20030718075257.01f04708@pop.ptld.qwest.net> <000501c34d39$32d74830$1a02a8c0@BasementDell> Message-ID: <5.2.0.9.0.20030718114629.02598d20@pop.ptld.qwest.net> At 11:37 AM 7/18/2003 -0700, Kirby Urner wrote: >Feedback welcome. > >Kirby I see a couple problems already. I'll go ahead and add some repository links now, as I fix existing problems. Kirby From urnerk@qwest.net Fri Jul 18 20:17:16 2003 From: urnerk@qwest.net (Kirby Urner) Date: Fri, 18 Jul 2003 12:17:16 -0700 Subject: [Edu-sig] edu-sig page revamped In-Reply-To: References: <5.2.0.9.0.20030718113332.02592ea0@pop.ptld.qwest.net> Message-ID: <5.2.0.9.0.20030718121353.025a8e40@pop.ptld.qwest.net> At 02:56 PM 7/18/2003 -0400, Beth Platt wrote: >Once again, an excellent resource from Kirby. However, I'm curious as to why >macpython wasn't included? Tell me more. When I test installed macpython at my daughters school, on an iMac running OS9 (I think it was), it installed Tcl and used a version of IDLE as the shell GUI. It didn't seem to color-code the syntax though. Is there a different GUI shell for OS9, not based on Tcl? Pardon my ignorance of Macworld. Kirby PS: seemed like the Apple PowerBook (or is it called an iBook) was about the most popular choice of laptop with the Open Source geeks at OSCON. From ajs@optonline.net Sat Jul 19 02:13:00 2003 From: ajs@optonline.net (Arthur) Date: Fri, 18 Jul 2003 20:13:00 -0500 Subject: [Edu-sig] re: TeachScheme Message-ID: <000701c34d92$e5db3be0$1a02a8c0@BasementDell> >How do we go about being less subject to this kind of >criticism, to the extent it is righteous criticism? My question. And my answer. I would like to be able to say to Shriram: There is no such thing as a "Python-in-education movement". You are raging at vapor. There are numbers of individuals, and teams of individuals, who happen to have found the Python programming language useful in achieving goals related to education Some of us think that happens to be no coincidence. The language is well designed, with intent, to lend itself well to such goals. Beyond that, there is - as well proven here - no consensus among those individuals about much of anything. And no particular concern among them, as to whether others decide to use Python for their own education projects. What movement? I think the new edu-sig page better reflects *just the facts mam*. Who happens to be doing what. Though, honestly I wish it went a step or two further, in being *just* that. Dammit - I don't know what was "pioneering" about the Computer Programming for Everybody in concept or results - and if folks chose to see my saying that as a gratuitous swipe at Guido, rather how I intend it, as a plea for *just the facts mam* as the most Pythonic approach to the involvement of its practitioners in the area of education - so be it. Guido gets the credit he well deserves, and the gratitude of myself, among others, as the designer of the programming language which many of us - each in our own way - have found to be useful (in my case, actually, *important*) in our lives. Can we leave it at that, perhaps? Art From tim.one@comcast.net Sat Jul 19 02:39:26 2003 From: tim.one@comcast.net (Tim Peters) Date: Fri, 18 Jul 2003 21:39:26 -0400 Subject: [Edu-sig] re: TeachScheme In-Reply-To: <000501c34d39$32d74830$1a02a8c0@BasementDell> Message-ID: [Arthur] > http://www.cs.utah.edu/plt/mailarch/plt-scheme-2000/msg00676.html > > Thought I would do a little google to test my theory about whether the > TeachScheme guys feel abused. > > My intuition gets (another) A+ grade. The referenced msg appears to be 3 years old, and it's no secret they felt abused in 2000 -- CP4E was a hot topic, and at the time it appeared to be on track to get additional & significant funding. > Anybody can feel abused about anything. People in the Scheme world specialize in it . > The question is to what extent they have a legimate case. Guido made changes to his proposal based on Matthias's specific complaints at the time. > You know my feelings. > > How do we go about being less subject to this kind of criticism, to > the extent it is righteous criticism? Are they still sniping at Python? Fine, if so and they enjoy that, but I haven't seen any of that lately. The only effect of this resurrection I've seen is that Kirby removed the link to TeachScheme from the Edu-SIG page. If that prevents someone from stumbling into TeachScheme who otherwise would have, I'd judge it a net loss. It's a wonderful project, even if it suffers from too much intellectual depth at the expense of shallow hacking . From urnerk@qwest.net Sat Jul 19 03:56:11 2003 From: urnerk@qwest.net (Kirby Urner) Date: Fri, 18 Jul 2003 19:56:11 -0700 Subject: [Edu-sig] re: TeachScheme In-Reply-To: References: <000501c34d39$32d74830$1a02a8c0@BasementDell> Message-ID: <5.2.0.9.0.20030718194547.01854c60@pop.ptld.qwest.net> At 09:39 PM 7/18/2003 -0400, Tim Peters wrote: >Are they still sniping at Python? Fine, if so and they enjoy that, but I >haven't seen any of that lately. The only effect of this resurrection I've >seen is that Kirby removed the link to TeachScheme from the Edu-SIG page. >If that prevents someone from stumbling into TeachScheme who otherwise would >have, I'd judge it a net loss. It's a wonderful project, even if it suffers >from too much intellectual depth at the expense of shallow hacking . Yeah, somewhat old news. Lots of languages should be able to make, or have already made, good inroads into the education sphere. I don't think an edu-sig page re Python should commit to providing such a global set of links. The Scheme link set a wrong precedent, the way I see it now. It's not a reflection of what I think about the program (I think highly of it). If someone else maintains a comprehensive Programming in Education page (across multiple languages), I could see linking to *that*. Kirby From ajs@optonline.net Sat Jul 19 05:33:37 2003 From: ajs@optonline.net (Arthur) Date: Fri, 18 Jul 2003 23:33:37 -0500 Subject: [Edu-sig] re: TeachScheme Message-ID: <000501c34dae$ec649990$1a02a8c0@BasementDell> Tim writes - >The only effect of this resurrection I've seen is that Kirby removed the link to TeachScheme from the Edu-SIG page. >If that prevents someone from stumbling into TeachScheme who otherwise would have, I'd judge it a net loss. Not to stand still in the face of a potential net loss: My recommendation is to include the recently released DrPython editor in the Shells and Editors section of the page. I make that recommend based on the fact that I have tried DrPython, and find it -as advertised - a clean and simple environment for teaching. We might then link to the stated inspiration of of DrPython, DrScheme of the TeachScheme project. The intent of DrPython clearly being imitation as a form of flattery/respect - as per Kirby's earlier point made. Net gain. Art From urnerk@qwest.net Sat Jul 19 05:07:58 2003 From: urnerk@qwest.net (Kirby Urner) Date: Fri, 18 Jul 2003 21:07:58 -0700 Subject: [Edu-sig] re: TeachScheme In-Reply-To: <000501c34dae$ec649990$1a02a8c0@BasementDell> Message-ID: <5.2.0.9.0.20030718205340.0188a6f0@pop.ptld.qwest.net> At 11:33 PM 7/18/2003 -0500, Arthur wrote: >My recommendation is to include the recently released DrPython editor in the >Shells and Editors section of the page. I make that recommend based on the >fact that I have tried DrPython, and find it -as advertised - a clean and >simple environment for teaching. We might then link to the stated >inspiration of of DrPython, DrScheme of the TeachScheme project. The intent >of DrPython clearly being imitation as a form of flattery/respect - as per >Kirby's earlier point made. > >Net gain. > >Art Good idea to include a link to DrPython. I'll add that on my next revision. But I might leave the link to DrScheme for the DrPython web page. He just needs to make that link live (or the curious will just google). On the other hand, PyGeo's makes mention of Cabri and Sketchpad. I suppose I could make those live links as well. I see some other stuff I could turn on too (SDL, wxWindows). I'll give it some thought.... OK, done thinking. I'll add some new links next revision, including to DrScheme under DrPython ( http://www.drscheme.org -- only one more click to TeachScheme! from there) Thanks again for the good suggestion. Kirby From Jason Cunliffe" panel discussion -- How to Interview a Programmer Bruce Eckel: I ask candidates to create an object model of a chicken. This eliminates any problems with uncertainties about the problem domain, because everyone knows what a chicken is. I think it also jars people away from the technical details of a computer. It tests to see if they are capable of thinking about the big picture. http://www.artima.com/wbc/interprog.html -- Jason From tim.one@comcast.net Mon Jul 21 03:49:42 2003 From: tim.one@comcast.net (Tim Peters) Date: Sun, 20 Jul 2003 22:49:42 -0400 Subject: [Edu-sig] re: TeachScheme In-Reply-To: <000501c34dae$ec649990$1a02a8c0@BasementDell> Message-ID: [Arthur] > ... > My recommendation is to include the recently released DrPython editor > in the Shells and Editors section of the page. I make that recommend > based on the fact that I have tried DrPython, and find it -as > advertised - a clean and simple environment for teaching. We might > then link to the stated inspiration of of DrPython, DrScheme of the > TeachScheme project. The intent of DrPython clearly being imitation > as a form of flattery/respect - as per Kirby's earlier point made. That's a happy idea -- thanks! From ajsiegel@optonline.net Tue Jul 22 17:09:05 2003 From: ajsiegel@optonline.net (Arthur) Date: Tue, 22 Jul 2003 12:09:05 -0400 Subject: [Edu-sig] Fw: [Ofset-freeduc] News about Freeduc Message-ID: <000501c3506b$944071c0$0c02a8c0@Arts> ----- Original Message ----- From: "Hilaire Fernandes" To: "Freeduc" Sent: Tuesday, July 22, 2003 12:00 PM Subject: [Ofset-freeduc] News about Freeduc > Hello all, > > A couple of news about Freeduc: > > * We plane for a new version in october/november > > * This version will be supported by UNESCO (yes, UNESCO !), therefore > this dedicated version will come with a booklet in at least 3 languages > (English, French and Spanish). The booklet is mosty ready, therefore we > need help to translate it in English and Spanish. If there is volunteer > just let me know privately so I can contact you when the document will > be ready for translation. > > * We have set up a community portal, > http://freeduc.linuxtag.uni-kl.de:9673/cps/; kindly hosted by Klaus > Knopper. I suggest you register in the portal then let me know so I can > add you to the appropriate groups. > > * In the portal, under the Freeduc/Documentation section I have already > added a small note concerning how is organized the documentation. Read > it if you want to give a hand. > > > Hilaire Fernandes > > Free the school with Gnu/Linux > http://www.ofset.org/projects/edusoft.html > > > ------------------------------------------------------- > This SF.net email is sponsored by: VM Ware > With VMware you can run multiple operating systems on a single machine. > WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the > same time. Free trial click here: http://www.vmware.com/wl/offer/345/0 > _______________________________________________ > Ofset-freeduc mailing list > Ofset-freeduc@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/ofset-freeduc From urnerk@qwest.net Tue Jul 22 20:38:55 2003 From: urnerk@qwest.net (Kirby Urner) Date: Tue, 22 Jul 2003 12:38:55 -0700 Subject: [Edu-sig] re: TeachScheme In-Reply-To: <000501c34dae$ec649990$1a02a8c0@BasementDell> Message-ID: <5.2.0.9.0.20030722123103.01f62cf0@pop.ptld.qwest.net> Apropos our recent thread, I was inspired to boot DrScheme and challenge myself to oil the rusty wheel works (i.e. my brain) enough to crank out a small Scheme program for totient(n) -- or as Schemers would write it: (totient n). Then I did the same in Python. Then I modified both. Then I explained how this isn't the "best" algorithm in either case (but maybe we'll get to that later): http://www.mathforum.org/epigone/k12.ed.math/gaupholflo For those who've read a lot of my stuff over the years, it's the same old same old. I don't seem to get tired of it. Kirby PS: here's the code I ended up with: Scheme: ;; totient : integer -> integer ;; compute the number of positives < n that are ;; relatively prime to n (define (totient n) (if (not (and (integer? n)(>= n 0))) "Incorrect input" (begin (let loop ((tot 0)(pos n)) (if (> pos 0) (loop (+ tot (if (= 1 (gcd n pos)) 1 0)) (- pos 1)) tot ) ) ) ) ) Python: def totient(n): """ count totatives of n, assuming gcd already defined """ if not (type(n)==type(1) and n>=0): raise ValueError, 'Invalid input type' tot,pos = 0, n while pos>0: if gcd(pos,n)==1: tot += 1 pos -= 1 return tot From etd1@edtechdev.org Thu Jul 24 22:25:45 2003 From: etd1@edtechdev.org (Doug Holton) Date: Thu, 24 Jul 2003 16:25:45 -0500 Subject: [Edu-sig] Educational Foundry at Sourceforge Message-ID: <3F204ED9.6040507@edtechdev.org> Hi, I submitted a feature request at SourceForge to create an Educational Foundry: Here are examples of other foundries at Sourceforge and a FAQ: http://foundries.sourceforge.net/ FAQ: http://sourceforge.net/docman/display_doc.php?docid=889&group_id=1 I think an educational foundry would help highlight some of the educational development efforts like those listed at the python edu-sig page. I'm using python myself to develop a couple of educational apps. Feel free to add any comments to the above feature request, or add your own feature request. I'm not looking necessarily to be one of the Foundry Guides myself, although I will if need be. If you are interested in being a guide please add a comment. Thanks, -Doug From jeff@elkner.net Fri Jul 25 04:41:53 2003 From: jeff@elkner.net (Jeffrey Elkner) Date: 24 Jul 2003 23:41:53 -0400 Subject: [Edu-sig] A "Python in Education" track at PyCon 2004? In-Reply-To: <200304300452.h3U4qFGW008550@holycow.sandiego.edu> References: <200304300452.h3U4qFGW008550@holycow.sandiego.edu> Message-ID: <1059104513.4260.46.camel@gopher2> Hi All, I've been talking to Steve Holden about my interest in organizing a "Python in Education" track at next years PyCon. The message below just appeared on the pycon-organizers list, so I thought I would pass it along here and ask you all if you are thinking about attending PyCon next year and if you would be interested in a Python in Education track. Thanks! jeff PyCon DC 2004 Kickoff! > > Following on the heels of the successful PyCon DC 2003, we're getting an > early start for PyCon DC 2004. Details are not final, but we're planning > to hold the conference in late March, with a two-day sprint before the > conference. > > The deadline for presentation proposals is December 1. Proposals should > be an abstract or outline of five hundred (500) to two thousand (2000) > words. Proposals will be accepted by December 31. The deadline for > submitting the final presentation in electronic form is February 15. > > Early-bird registration will be $150 (through February 1), standard > registration will be $200 (through March 15), and on-site registration > will be $250. We hope to have the registration system on-line soon. > -- > Aahz (aahz@pythoncraft.com) <*> http://www.pythoncraft.com/ From ajsiegel@optonline.net Fri Jul 25 21:54:53 2003 From: ajsiegel@optonline.net (Arthur) Date: Fri, 25 Jul 2003 16:54:53 -0400 Subject: [Edu-sig] re: A "Python in Education" track at PyCon 2004? Message-ID: <000701c352ee$ffbebc10$0c02a8c0@Arts> Jeff writes: >I've been talking to Steve Holden about my interest in organizing a >"Python in Education" track at next years PyCon. The message below just >appeared on the pycon-organizers list, so I thought I would pass it >along here and ask you all if you are thinking about attending PyCon >next year and if you would be interested in a Python in Education track. I would hope to be there and - inspired by Kirby's talk - hope to submit a proposal for a PyGeo presentation. It would be nice to have a Python in Education track, if enough interest can be generated. To do so, it would be important, IMO, to make sure the community sees the track defined as broadly as possible. Any levelof education. Any degree of esoterica. As intimidating as the possiblity of having to follow a PyGeo presentation miught be ;) - I would guess there would be a good number of proposals for presentations. Can it go forward tentatively - final determination made after assessing whether the proposal submissions justify a separate track? Art From jeff@elkner.net Fri Jul 25 22:08:25 2003 From: jeff@elkner.net (Jeffrey Elkner) Date: 25 Jul 2003 17:08:25 -0400 Subject: [Edu-sig] re: A "Python in Education" track at PyCon 2004? In-Reply-To: <000701c352ee$ffbebc10$0c02a8c0@Arts> References: <000701c352ee$ffbebc10$0c02a8c0@Arts> Message-ID: <1059167305.3449.67.camel@gopher2> On Fri, 2003-07-25 at 16:54, Arthur wrote: > Jeff writes: > > >I've been talking to Steve Holden about my interest in organizing a > >"Python in Education" track at next years PyCon. The message below just > >appeared on the pycon-organizers list, so I thought I would pass it > >along here and ask you all if you are thinking about attending PyCon > >next year and if you would be interested in a Python in Education track. > > I would hope to be there and - inspired by Kirby's talk - hope to submit a > proposal for a PyGeo presentation. Cool! I would love to attend. > It would be nice to have a Python in Education track, if enough interest can > be generated. I think it can. > To do so, it would be important, IMO, to make sure the community sees the > track defined as broadly as possible. > > Any levelof education. > > Any degree of esoterica. > > As intimidating as the possiblity of having to follow a PyGeo presentation > miught be ;) - > > I would guess there would be a good number of proposals for presentations. I don't know how the process works. I was only trying to figure out at this stage if it was worth moving forward with it. It seems that it is. > Can it go forward tentatively - final determination made after assessing > whether the proposal submissions justify a separate track? Well, it *is* going forward tentatively. In fact, I haven't even brought this up with the conference organizors yet (aside from Steve Holden). I wanted to see if there was any interest before going any further with it. I figured this list was as good a place as any to start. I've received three replys already, so I'm feeling pretty encouraged ;-) jeff elkner open book project at ibiblio http://ibiblio.org/obp From urnerk@qwest.net Fri Jul 25 22:34:51 2003 From: urnerk@qwest.net (Kirby Urner) Date: Fri, 25 Jul 2003 14:34:51 -0700 Subject: [Edu-sig] re: A "Python in Education" track at PyCon 2004? In-Reply-To: <1059167305.3449.67.camel@gopher2> References: <000701c352ee$ffbebc10$0c02a8c0@Arts> <000701c352ee$ffbebc10$0c02a8c0@Arts> Message-ID: <5.2.0.9.0.20030725143027.01dcbc50@pop.ptld.qwest.net> At 05:08 PM 7/25/2003 -0400, Jeffrey Elkner wrote: >Well, it *is* going forward tentatively. In fact, I haven't even >brought this up with the conference organizors yet (aside from Steve >Holden). I wanted to see if there was any interest before going any >further with it. I figured this list was as good a place as any to >start. I've received three replys already, so I'm feeling pretty >encouraged ;-) > >jeff elkner >open book project at ibiblio >http://ibiblio.org/obp I offer further encouragement. I'd also like to submit a proposal. It's good to have it be a "track" because in my mind what that means is we won't schedule the Python in Education talks in parallel, which means, whether I present or not, if I'm there (as I hope to be), I'll have a reasonably good chance of catching these talks without worrying about a lot of time slot conflicts. Of course if you get just a whole lot of good proposals, then parallelism might well creep into the picture. Oh well. That'd be a good sign (for the future of Python in Education), even though it'd be frustrating to some PyCon attenders. Kirby From jeff@elkner.net Sat Jul 26 01:01:29 2003 From: jeff@elkner.net (Jeffrey Elkner) Date: 25 Jul 2003 20:01:29 -0400 Subject: [Edu-sig] re: A "Python in Education" track at PyCon 2004? In-Reply-To: <5.2.0.9.0.20030725143027.01dcbc50@pop.ptld.qwest.net> References: <000701c352ee$ffbebc10$0c02a8c0@Arts> <000701c352ee$ffbebc10$0c02a8c0@Arts> <5.2.0.9.0.20030725143027.01dcbc50@pop.ptld.qwest.net> Message-ID: <1059177689.4049.3.camel@gopher2> On Fri, 2003-07-25 at 17:34, Kirby Urner wrote: > I offer further encouragement. > > I'd also like to submit a proposal. > > It's good to have it be a "track" because in my mind what > that means is we won't schedule the Python in Education > talks in parallel, which means, whether I present or not, > if I'm there (as I hope to be), I'll have a reasonably > good chance of catching these talks without worrying > about a lot of time slot conflicts. > > Of course if you get just a whole lot of good proposals, > then parallelism might well creep into the picture. > Oh well. That'd be a good sign (for the future of > Python in Education), even though it'd be frustrating > to some PyCon attenders. Thanks for both the encouragement and the proposal, Kirby. I'm getting together with Steve on Monday to talk about this, so I'll follow up with another mailing to the list after that. Thanks again! jeff elkner open book project at ibiblio http://ibiblio.org/obp From Jason Cunliffe" Hi. I've been following the sordid tale of SCOvs.IBM. I found two excellent sites... GROKLAW, a weblog cover legal matters "Putting some meat on legal news' bones." http://radio.weblogs.com/0120124/ and a superb wiki tracking the SCO scandal http://twiki.iwethey.org/twiki/bin/view/Main/SCOvsIBM I am beginning to think the SCO debacle it will emerge as the best thing which ever happened to OpenSource and GNU, because by the end of the affair SCO will lose infamously. But also because corporate business, mainstream media, and the courts will all finally understand the legal ethical and programming issues. It's a little like how America learns Geography every time it goes to war [ouch did I say that?]. Anyway, I am very curious to learn if those of you teaching/using Python in schools also take time to discuss GNU and related topics with your students? Stories comments reaction most welcome.. >From a cultural perspective GPL may be one of the most important pieces of programming ever done. Certainly it is Stallman's great hack, one for the history and law books. GPL: The GNU General Public License www.gnu.org/licenses/licenses.html#GPL "In the GNU project, our aim is to give all users the freedom to redistribute and change GNU software. If middlemen could strip off the freedom, we might have many users, but those users would not have freedom. So instead of putting GNU software in the public domain, we ``copyleft'' it. Copyleft says that anyone who redistributes the software, with or without changes, must pass along the freedom to further copy and change it. Copyleft guarantees that every user has freedom." GPL is not all, but it is the original mountain from which the other collaborative licenses flow and define themselves. thanks Jason ______________________________________________ Jason Cunliffe [NOMADICS: Director art+design] Tel/fax: +1 718 422-1078 jasonic@nomadics.org N 43:00.000' W 074:31.875' ALT:1144 ft 84 Henry Street #3C Brooklyn NY 11201 USA http://tranzilla.net/.v From urnerk@qwest.net Wed Jul 30 19:14:34 2003 From: urnerk@qwest.net (Kirby Urner) Date: Wed, 30 Jul 2003 11:14:34 -0700 Subject: [Edu-sig] Pygame anyone? In-Reply-To: <002401c355de$43650360$6401a8c0@vaio> Message-ID: <5.2.0.9.0.20030730110732.01cdbf10@pop.ptld.qwest.net> I've started to dive into Pygame more intensively and wondered if any other subscribers to edu-sig are exploring its potential. My focus right now is on drawing 2-dimensional graphs. I'm finding this entertaining, and suppose students might as well. I'd be happy to share source code if anyone's interested in learning it with me -- with the understanding that this is beginner level stuff vis-a-vis that package. Kirby Footnote: I'm getting in the habit of using Patrick O'Brien's PyAlaMode for my editing/shell work these days. It's quite nice. Newly inspired at OSCON, I'll be getting into wxPython more as well, maybe try to wrap my mind around PythonCard a little more at the source code level (Kevin has some really cool math-related demos). I'll be waiting on OpenGL stuff (also integrated into PyGame and wxWindows) until it's ready for 2.3, which is just about the only Python I'm using for development these days. From delza@blastradius.com Wed Jul 30 19:26:07 2003 From: delza@blastradius.com (Dethe Elza) Date: Wed, 30 Jul 2003 11:26:07 -0700 Subject: [Edu-sig] Pygame anyone? In-Reply-To: <5.2.0.9.0.20030730110732.01cdbf10@pop.ptld.qwest.net> Message-ID: <4901734E-C2BB-11D7-B492-0003939B59E8@blastradius.com> Kirby, I've been quiet on the list lately, but I always enjoy your code examples and would be happy to see you share them. Pygame is very interesting and something I've been meaning to find time to explore. I've been discussing a potential game with my daughter (age 6) involving fairies. So far I have a pair of fairy (or butterfly) wings flapping in VPython, but haven't gotten further. Perhaps I'd make faster progress with a sprite-based Pygame version. I want to make it a toolkit for her to begin exploring simple programming, like turtle graphics is to Logo. If there's any interest I can post it. Not sure how crufty it is, it's been awhile since I've worked on it. --Dethe From urnerk@qwest.net Thu Jul 31 00:19:53 2003 From: urnerk@qwest.net (Kirby Urner) Date: Wed, 30 Jul 2003 16:19:53 -0700 Subject: [Edu-sig] Pygame anyone? In-Reply-To: <4901734E-C2BB-11D7-B492-0003939B59E8@blastradius.com> References: <5.2.0.9.0.20030730110732.01cdbf10@pop.ptld.qwest.net> Message-ID: <5.2.0.9.0.20030730161253.0254f808@pop.ptld.qwest.net> At 11:26 AM 7/30/2003 -0700, Dethe Elza wrote: >Kirby, > >I've been quiet on the list lately, but I always enjoy your code examples >and would be happy to see you share them. Pygame is very interesting and >something I've been meaning to find time to explore. Thanks for your interest Dethe. It's a bit too much to post to this list (390 lines and counting), so I've put my recent playing around on the web at: http://www.inetarena.com/~pdx4d/ocn/python/pygame/ I've only tested it in Windows, so if you're doing the Linux thing, I'd be interested to know if everything works. I was pretty liberal with comments, to help with learning (who knows when I might want to understand this again). >I've been discussing a potential game with my daughter (age 6) involving >fairies. So far I have a pair of fairy (or butterfly) wings flapping in >VPython, but haven't gotten further. Perhaps I'd make faster progress >with a sprite-based Pygame version. I want to make it a toolkit for her >to begin exploring simple programming, like turtle graphics is to Logo. I had Tara (9) looking over my shoulder as I coded some of this today. It was her idea to do 7 concentric circles using VIBGYOR (the colors of the rainbow). I had to google for RGB values. I didn't really explain what I was doing as I entered them in hex. >If there's any interest I can post it. Not sure how crufty it is, it's >been awhile since I've worked on it. > >--Dethe I'd be interested. I have to see if VPython is working for me though. I'm using 2.3 and all my file associations point to 2.3. The 2.2 stuff doesn't work very well. That's a problem with Windows, makes it hard for several Pythons to co-exist. But there's always using a different box! Kirby From missive@hotmail.com Thu Jul 31 06:09:31 2003 From: missive@hotmail.com (Lee Harr) Date: Thu, 31 Jul 2003 05:09:31 +0000 Subject: [Edu-sig] Re: Pygame anyone? Message-ID: Hi; I have been working quite a lot lately on the pygsear framework which builds on python and pygame. One of my students was having a tough time getting the turtle graphics program to work with windows xp, so what I ended up doing is embedding a python interpreter inside of pygame. Basically another one of those "python moments" when I just say... wow. It's really pretty neat. I started using epydoc too, so the documentation is getting much better. Take a look and let me know what you think: pygsear is a programming framework using Python and Pygame. pygsear has classes for sprites, paths, widgets, events, sounds, networking (using Twisted) and more, and it comes with many of examples. More information is available here: http://www.nongnu.org/pygsear/ Download the latest version here: http://savannah.nongnu.org/files/?group=pygsear CHANGES: version 0.47.1 - test.py shoud be more easily runnable without installing - Allow load and save of penguin graphics sessions - Bump up some of the default font sizes - Removed inadvertent mixer.init() at start of lunar.py - Use event.wait() in modal Console widget - Arrow keys now work in TextInput widget - Changed Turtle.setColor and nudge_color slightly version 0.47 - Added Widget.Console for embedded python interactive interpreter - used in examples/interact.py for working with penguin graphics - Major changes to pygsear/Event.py - Event is now a subclass of pygame.sprite.Sprite - added a new EventGroup which subclasses sprite.Group - this allows Events to be grouped like Sprites. - added new examples/events.py to test Event changes. - Major cleanup to Util.load_* functions. - get_dirs() now tells where to look for files to load - All demos updated and are now working - Drawable.Image can now take a Surface for the image - Fixed bug in Drawable.String - can now take an empty string - Initial work at using sound - use Util.load_sound to find and load .wav files - load_sound will return DummySound objects if sound is broken - examples/lunar.py is the first to get sounds - Added line wrapped text code from Pygame PCR - used in Widget.Dialog_OK and Widget.Console - added trim parameter. Trims surface to just hold the text. _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From delza@blastradius.com Thu Jul 31 07:18:44 2003 From: delza@blastradius.com (Dethe Elza) Date: Wed, 30 Jul 2003 23:18:44 -0700 Subject: [Edu-sig] Pygame anyone? In-Reply-To: <5.2.0.9.0.20030730161253.0254f808@pop.ptld.qwest.net> Message-ID: > Thanks for your interest Dethe. It's a bit too much to post to this > list > (390 lines and counting), so I've put my recent playing around on the > web > at: http://www.inetarena.com/~pdx4d/ocn/python/pygame/ Posting a link is fine, and often prefereable to inline code. Python especially doesn't always survive transit via email due to whitespace and linebreak mangling. > I've only tested it in Windows, so if you're doing the Linux thing, I'd > be interested to know if everything works. I was pretty liberal with > comments, to help with learning (who knows when I might want to > understand > this again). I'm doing the OS X thing, but I have the linux thing lying around too. I'll kick the tires in both. > I had Tara (9) looking over my shoulder as I coded some of this today. > It was her idea to do 7 concentric circles using VIBGYOR (the colors > of the rainbow). I had to google for RGB values. I didn't really > explain what I was doing as I entered them in hex. That's very cool. I wrote a quick lookup for some basic hex values years ago. Dunno if it would be helpful, but it lives here: http://delza.alliances.org/gifs/safecolors.html It dates from the days when table support in browsers was new and windows defaulted to 16 color mode. > I'd be interested. I have to see if VPython is working for me though. > I'm using 2.3 and all my file associations point to 2.3. The 2.2 stuff > doesn't work very well. That's a problem with Windows, makes it hard > for several Pythons to co-exist. But there's always using a different > box! I don't see a version of VPython for 2.3 yet. It may take some time for VPython to catch up. I installed ActiveState's Python 2.2 on my 'doze box at work and VPython ran OK with it. I hope someday VPython actually runs on OS X (right now they've ported enough that it runs under X on OS X which isn't the same thing at all). PythonWare distributes a Python for Windows which doesn't muck about with the registry, so it's easy to have multiple installs. Unfortunately, the last version they packaged appears to be 2.1. I'll put some of my half-baked projects on a server somewhere tomorrow and post a link. --Dethe From ajsiegel@optonline.net Thu Jul 31 15:58:52 2003 From: ajsiegel@optonline.net (Arthur) Date: Thu, 31 Jul 2003 10:58:52 -0400 Subject: [Edu-sig] re: Pygame anyone? Message-ID: <000501c35774$4291f370$0c02a8c0@Arts> Dethe writes - >I hope someday VPython actually runs on OS X (right now they've >ported enough that it runs under X on OS X which isn't the same thing at >all. Looking at the wgl.cpp (for Windows) and xgl.cpp(for gtkglarea), it looks pretty straight forward. Get a OpenGL context and some default mouse beahavior. And I don't see why anything else substantial in the VPython code would be platform specific. Looking at the current source, there is a module called "aglcx.cpp", which seems to be Mac specifc OpenGL context code analogous to the wgl and xgl code. Am I wrong in my assumption that this is OS X native? Perhaps I am right, but it isn't rolled out yet. Or is it pre-OS X Mac code. I am a little lost, in the Mac world. Lost-er than usual, that is. But a native OS X context does not sound like a particularly big thing. Not that I could pull it off. What is the IDLE native OS X status? Are these issues in any way related? If someone here can't clarify, I'll try to get an understanding by inquiring on the VPython list. Oh yeah - pygame. What I am picking up is that it is pretty weighty. I see it as part of projects that don't have anything to do directly with gaming. Can't think of specifcs right now. But it seems to provide an infrastructure for crossplatform GUI and graphical work (assumedly through the auspices of SDL) that has very broad utility. Definitely on my todo list. Starting by getting a handle on pygear, as a matter of fact. Art From delza@blastradius.com Thu Jul 31 16:29:30 2003 From: delza@blastradius.com (Dethe Elza) Date: Thu, 31 Jul 2003 08:29:30 -0700 Subject: [Edu-sig] Re: Pygame anyone? In-Reply-To: Message-ID: Yes, I think it's definitely time to have a look at pygsear. I'll let you know when I have some results. --Dethe On Wednesday, July 30, 2003, at 10:09 PM, Lee Harr wrote: > Hi; > > I have been working quite a lot lately on the pygsear framework which > builds on python and pygame. One of my students was having a tough > time getting the turtle graphics program to work with windows xp, so > what > I ended up doing is embedding a python interpreter inside of pygame. From delza@blastradius.com Thu Jul 31 18:29:50 2003 From: delza@blastradius.com (Dethe Elza) Date: Thu, 31 Jul 2003 10:29:50 -0700 Subject: [Edu-sig] Code snippets In-Reply-To: <5.2.0.9.0.20030730161253.0254f808@pop.ptld.qwest.net> Message-ID: <9724FCE4-C37C-11D7-B492-0003939B59E8@blastradius.com> Hi all, I've finally started to put up some of my python snippets. Two things so far: the start of a Logo-like turtle graphics game in Tkinter, and flapping butterfly-like wings in VPython. More to come soon. Both tangentially related to education %-) http://livingcode.ca/rotfl Feedback welcome and appreciated. --Dethe From delza@blastradius.com Thu Jul 31 18:39:49 2003 From: delza@blastradius.com (Dethe Elza) Date: Thu, 31 Jul 2003 10:39:49 -0700 Subject: [Edu-sig] Pygame anyone? In-Reply-To: <5.2.0.9.0.20030730161253.0254f808@pop.ptld.qwest.net> Message-ID: On Wednesday, July 30, 2003, at 04:19 PM, Kirby Urner wrote: > I've only tested it in Windows, so if you're doing the Linux thing, I'd > be interested to know if everything works. I was pretty liberal with > comments, to help with learning (who knows when I might want to > understand > this again). Works fine under OS X, haven't had a chance to install pygame on Linux yet. The only problem I had was minor: had to download 5 files and put them in the right place relative to each other. A zip or other such single-file download would be nice. Not a big deal when it's only five files. Otherwise, it worked like a charm. Interesting approach to visualizing functions. --Dethe