From urner@alumni.Princeton.EDU Sun Sep 10 10:01:59 2000 From: urner@alumni.Princeton.EDU (Kirby Urner) Date: Sun, 10 Sep 2000 02:01:59 -0700 Subject: [Edu-sig] Python 2.0 and teaching precalculus Message-ID: <02jmrskpt2qicgrln7kd9g2hrjjt3l1t77@4ax.com> Keywords: Python 2.0, cli, precalc, discrete math, graphing, domain, range, function, povray, derivative, epsilon, ocn Originally posted to: edu-sig@python.org (list), comp.lang.python (news) Cross-posted to: calc-reform (list, Swarthmore Math Forum) Web anchor: http://www.inetarena.com/~pdx4d/ocn/precalc.html The newest Python (2.0 in beta) has some useful constructs for those of you using CLI for teaching precalc/calc.[1] For example, zip() will compose (domain,range) pairs from separate lists [x1,x2..] [f(x1), f(x2)..]... >>> dom = [-3,-2,-1,0,1,2,3] >>> rng = [x*x for x in dom] # see note below >>> rng [9, 4, 1, 0, 1, 4, 9] >>> func = zip(dom,rng) >>> func [(-3, 9), (-2, 4), (-1, 1), (0, 0), (1, 1), (2, 4), (3, 9)] Note: this [f(x) for x in list] "list comprehension" construct is also new with 2.0. Of course [-3,-2,-1,0,1,2,3] could be generated using the built-in range function: >>> dom = range(-3,3,1) Be careful not to use key term 'range' as your output list name, as you'll obscure the built-in range() with your variable and get an error message next time you try the built-in. Like this: >>> range = [x*x for x in dom] >>> range [9, 4, 1, 0, 1, 4, 9] >>> range(-10,10,1) Traceback (innermost last): File "", line 1, in ? range(-10,10,1) TypeError: call of non-function (type list) Uh oh. Now you've gotta go: >>> del range to erase your variable and get the built-in back. Given range() only works with integers, my precalc.py module uses a longer mkdomain() function. See source code.[2] In precalc classes, one obvious use of these functions is to build a discrete math analog of the derivative using definite epsilon. Let's call this function wiggle() in that we're "wiggling" a variable x to compute [f(x+epsilon)-f(x)]/epsilon Here's wiggle(): def wiggle(function,input,epsilon=1e-10): """ Accepts a function, value and returns delta f / delta x for small epsilon (default of 1^-10 may be overridden) """ return (function(input+epsilon) - function(input))/epsilon Let's go to trig and run wiggle on the sine function, for a domain -pi <= x <= pi. >>> from precalc import * >>> dom = mkdomain(-math.pi,math.pi,0.1) # note step by 0.1 >>> rng = [wiggle(math.sin,x) for x in dom] >>> func = zip(dom,rng) >>> sine = zip(dom,[math.sin(x) for x in dom]) # sine function So func now contains wiggled-sine values, which we can graph and compare with the graph of cosine x. Lets graph the sine and func (domain,range) pairs. My graphit() function is a "connect the dots" type, i.e. assume continuity and fills in spaces between vertices. This gives us the smooth curves students are used to seeing in text books. >>> import povray >>> drawfile = povray.Povray("wiggle1.pov",cf=15,cx=0,cy=0) # [3] >>> graphit(func,drawfile) # accepts list of [(dom,rng)] pairs >>> drawfile.cylcolor = "Red" >>> drawfile.sphcolor = "Red" >>> graphit(sine,drawfile) >>> drawfile.close() The output graph is of both the original sine wave, and the wiggle function (a discrete math analog of the derivative). See See Graph 1 at: http://www.inetarena.com/~pdx4d/ocn/precalc.html Let's do one more example: f(x) = sin(x^2) x:-pi<=x<=pi >>> def G(x): return math.sin(x**2) # ** = Python's exponentiator >>> funcG = zip(dom,[G(x) for x in dom]) >>> wiggleG = zip(dom,[wiggle(G,x) for x in dom]) >>> drawfile = povray.Povray("wiggle2.pov",cf=35,cx=0,cy=0) >>> graphit(wiggleG,drawfile) # accepts list of [(dom,rng)] pairs >>> drawfile.cylcolor = "Red" >>> drawfile.sphcolor = "Red" >>> graphit(funcG,drawfile) >>> drawfile.close() See Graph 2. If you've learned to differentiate composite functions, you know that the derivative of f(g(x)) = f'(g(x))*g'(x). In this case, that'd be 2*cos(x**2)*x. Lets plot this function and compare with wiggleG above: >>> def derivG(x): return 2*math.cos(x**2)*x >>> derivfuncG = zip(dom,[derivG(x) for x in dom]) >>> drawfile = povray.Povray("wiggle3.pov",cf=35,cx=0,cy=0) >>> graphit(derivfuncG,drawfile) # accepts list of [(dom,rng)] pairs >>> drawfile.close() See Graph 3. Clearly this looks like the same function. Note that this roller coaster function provides a good opportunity to discuss local minima and maxima, to show how the derivative crosses the x axis whenever slope = 0, is positive when original function is rising, negative when falling, and so forth. In sum, using the compact syntax of Python 2.0, you can make use of the CLI to facilitate comprehension of the derivative concept. With some tweaking of the above code, your functions could become multi-variable, setting the stage for multivariable calculus later on. Kirby Urner Curriculum writer Oregon Curriculum Network http://www.inetarena.com/~pdx4d/ocn/ [1] 2.0b is a free download from here: http://www.pythonlabs.com/tech/python2.0/index.html CLI = "command line interface" [2] http://www.inetarena.com/~pdx4d/ocn/python/precalc.html For code minus extraneous HTML tags: http://www.inetarena.com/~pdx4d/ocn/python/precalc.py Also see catenary.html (& .py), which uses much of the same functionality. [3] parameters and source for these additional graphing functions are described in my 'Numeracy + Computer Literacy' series starting at http://www.inetarena.com/~pdx4d/ocn/numeracy0.html You also need Povray at www.povray.org Many other solutions for creating graphs with Python have been developed, so don't feel overly tied to my Povray approach -------------------------------------------------------------- Cool Math Site of the Week: 'Synergetics on the Web' via http://west.camel.math.ca/Kabol/ -------------------------------------------------------------- From pdx4d@teleport.com Sun Sep 10 17:07:45 2000 From: pdx4d@teleport.com (Kirby Urner) Date: Sun, 10 Sep 2000 09:07:45 -0700 Subject: [Edu-sig] Python 2.0 and teaching precalculus In-Reply-To: <02jmrskpt2qicgrln7kd9g2hrjjt3l1t77@4ax.com> Message-ID: <3.0.3.32.20000910090745.00a76860@pop.teleport.com> >Here's wiggle(): > >def wiggle(function,input,epsilon=1e-10): > """ > Accepts a function, value and returns delta f / delta x > for small epsilon (default of 1^-10 may be overridden) > """ > return (function(input+epsilon) - function(input))/epsilon Fast reader on comp.lang.python caught the above typo error in my post (web version was OK). Of course 1^-10 is simply 1. Now that I stop to cogitate, I see this could be a real confusion. 1e-10 = 10^-10, just as 1e2 = 10^2 = 100. Need to remind students that #.###e### means #.### x 10**###, obviously not #.###**###. Kirby From v_kolobov@yahoo.com Fri Sep 15 15:31:48 2000 From: v_kolobov@yahoo.com (Kolobov Viktor) Date: Fri, 15 Sep 2000 07:31:48 -0700 (PDT) Subject: [Edu-sig] Re: Message-ID: <20000915143148.3700.qmail@web6305.mail.yahoo.com> confirm 126155 __________________________________________________ Do You Yahoo!? Yahoo! Mail - Free email you can access from anywhere! http://mail.yahoo.com/ From slitt@troubleshooters.com Fri Sep 15 16:14:50 2000 From: slitt@troubleshooters.com (Steve Litt) Date: Fri, 15 Sep 2000 11:14:50 -0400 Subject: [Edu-sig] Re: reducing fractions In-Reply-To: References: <7j2qmsstdgrh66sf625eeekqgt7jdn7gh7@4ax.com> Message-ID: <3.0.6.32.20000915111450.009b57d0@pop.pacificnet.net> At 12:41 PM 8/14/00 -0700, Kirby Urner wrote: >"Janet Johnson" wrote: > >>I teach 6th grade and every year my students seem to have a lot of >>difficulty with fractions, specifically, reducing or recognizing that a >>fraction isn't reduced. I have given them many ideas on how to tell, even >>to the point of writing out the factors for both the numerator and >>denominator. Does anyone have any suggestions on how to get this concept >>across to the students? Any suggestions would be greatly appreciated. >>Janet Johnson > >You could unsimplify some fractions e.g. 2/3 -> 10/15 >i.e. show the inverse of what it means to "simplify". > >If 'prime number' is already a concept, you could try >'relative prime' meaning no factors in common (i.e. >"a fraction is in lowest terms when the numerator and >denominator are both integers and are relative primes"). > >Along these lines, I really like your idea of writing >out the prime factors, crossing out those in common e.g.: > > 150/210 -> (3 x 5 x 2 x 5) / (7 x 3 x 2 x 5) -> 5/7 That's how my 7th grade teacher taught me to simplify fractions, and I've never been sorry. Steve Litt Webmaster, Troubleshooters.Com http://www.troubleshooters.com slitt@troubleshooters.com From slitt@troubleshooters.com Fri Sep 15 16:36:30 2000 From: slitt@troubleshooters.com (Steve Litt) Date: Fri, 15 Sep 2000 11:36:30 -0400 Subject: [Edu-sig] CP4E VideoPython learning to teatch / teaching to learn ..[xpost: was {'cpl',"don't laugh"}] In-Reply-To: <012001c0136d$9486d040$c3090740@megapathdsl.net> Message-ID: <3.0.6.32.20000915113630.008a7d50@pop.pacificnet.net> Hi Jason, You might be pleasantly surprised running Python under Linux instead of Windows. All that registry and autoexec stuff goes away. I've never used Python under Windows, but I bet some of your frustrations were Windows based, not necessarily Python based. I used to use Activestate Perl under Windows, and it was really quirky. Perl under Linux does exactly what it's supposed to (or at least as predictably as a "pathetically eclectic rubbish lister" can be). You mentioned the following: >Personally I would love to spend a couple of hours sitting next to an >experienced Python programmer who could show for example the process of >putting to together a program, testing it, shaping, how they react to error >messages, how they sculpt the code, how they might look at the problem a >couple of ways, how they use the tools, how many windows open, what they >look >at.. the real-world rhythm of a few hours in the life of a python program.. >even better if this was intelligently structured and re-playable with >examples. It would be nice to have a human being talk and type me through >some code. Are you sure you don't already know that stuff? My experience tells me that the "how tos" you mention above are language independent (assuming the language is oop and topdown capable like Python, Perl, Java, C++ (no MFC please), Delphi and the like). Once you've cleared the basic language-independent programming methodology hurdle (which you sound like you've already done), the next step is the language-specific "riffs" that make coding in your language more efficient, readable and easy. This is what you were discussing with import, os.getcwd(), os.chdir(), '__dir__','__builtins__', '__doc__', '__name__' to the mysteriously named, ubiquitous,>but frequently blank files named __init__.py. Jason, I think you should write a tutorial on all that stuff. You seem to have the curiosity and love of programming to do it. Maybe I can help you. Steve Steve Litt Webmaster, Troubleshooters.Com http://www.troubleshooters.com slitt@troubleshooters.com At 01:04 PM 8/31/00 -0400, Jason Cunliffe wrote: >Hello everyone > >At Guido's suggestion, I am forwarding this rather impassioned reply-post I >made to a recent thread on comp.lang.python. >I have also just now subscribed to Edu-sig@python.org >I have been following CP4E at a distance since I first heard about it and >look forwards to sharing skills, ideas and inspiration together.. >- Jason >________________________________________________________________ >Jason CUNLIFFE = NOMADICS.(Interactive Art and Technology).Design Director > >............................................................................ >.................................................... >Ken Mossman wrote in message >news:8oi3s4$8km$1@nobel2.pacific.net.sg... >> I have some JUNIOR staff >> and they are asking >> if there any CBT or multi-media >> courses for Python >> >> They are NEWBIES !! > >Hello. This is long post because you touched a nerve here... > >I am not only laughing, but crying too - at you folks for not appreciating >what a good question this really is! > >In fact I am wondering if in part this does not get at the heart of CP4E >[computer programming for everyone]..or what is missing in that regard.. > >Personally I would love to spend a couple of hours sitting next to an >experienced Python programmer who could show for example the process of >putting to together a program, testing it, shaping, how they react to error >messages, how they sculpt the code, how they might look at the problem a >couple of ways, how they use the tools, how many windows open, what they >look >at.. the real-world rhythm of a few hours in the life of a python program.. >even better if this was intelligently structured and re-playable with >examples. It would be nice to have a human being talk and type me through >some code. > >Yes there is no substitute for hands-on learning doing. But there is no >substitute for great teachers either! >And since we don t have the joys of python class in school or at our corner >adult-education center, we go to the web and read and download and hack >explore till hopefully it clicks. Some experienced folks can transfer their >previous learning fast, but for others who may have no experience or com >from another background, the first steps are very important.. > >But consider for example what happens when you open a high powered version 9 >piece of multimedia or 3d.modelling.animation software.. How many of your >here would last 15 minutes before a deep and overwhelming sense of drowning >mingled with your wide-eyed ambition and fascination. But try to get >something done... > >Ok so you get your hands on 1 hour video which shows you the basic features, >some examples and give you a reasonable grasp of what it the rhythm of >working and how many times you have click and open, where some shortcuts are >etc.. > >Lord I would love a Python video from the masters at work and play. In any >field there are rare few people who _really_ understand it, and even rarer >are the ones who can teach it. Python seems easy, well documented, has a >great community etc.. and it does. > >But fundamentally all the source code in the world does not help one >understand the process of programming. It does not show a newbie what to do >with all those modules and definitions after your put them under your >pillow! [http://www.python.org/doc/current/lib/lib.html] >Would someone just explain what all this stuff is and what are the 20 most >important things needed to know to get going..and then put the rest into >some context so one understands what to look forwards to. > >I will give you a very simple few example of the sorts of things which drove >me nuts when I first tried to run python on win32 > >1 - PYTHONPATH... where is this thing and how do I set it [in DOS ?, in >Python under some menu, by editing autostart.bat, in some hideous registry >sub.sub.sub.location.attribute > >2 - The manual says just make this cute 'helloworld.py' example and save >it. So you do, but you don't save/drop it into the main python directory >[that would be dumb right?] .. no like a good kid you make a nice folder >four yourself and put your first examples there. > >3 - Now when you do this and go 'import helloworld' you immediately get an >informative precise error reply written in Python[Babylonian]! >What's with that? > >For god sakes the newbie default for python should be > >a: make a folder called 'newbies' and tell newbies to save their scripts >there so they WILL run first time >b: add an auto-include folder paths python routine which means any folder >added to the default installation will be seen and run ok. > >4 - You get enthusiastic and a little braver and download some cool package. >unzip and put it into you python directory or maybe even somewhere else [god >help you poor soul]. Try to import that more errors..arggh. Eventually you >find somewhere after scouring the docs and newsgroups a couple of VITAL >commands: > >import sys, os >sys.path.append('c:\program files\python\coolnewpackage\') >os.chdir('c:\program files\python\coolnewpackage\') >os.listdir(os.getcwd()) > >- And after this there is the problem of packages and how modules behave >with namespace voodoo like the difference between >import * >from somewhere import something >from somewhere import * > >- how to get them work properly >- how to deal with the typical top 20 error messages python throws at you in >zealous yet Zen-like bliss > >- What is the relationship of import, os.getcwd(), os.chdir(), '__dir__', >'__builtins__', '__doc__', '__name__' to the mysteriously named, ubiquitous, >but frequently blank files named __init__.py ??? > >Can you explain that one to you mother? > >All the super tools in the world do not help if one does not know how to use >them or have a grasp of what they are capable of. IDLE and PythonWin get >better all the time, and now we are about to see lots more cool Python on >Windows via ActiveState etc. But this only ups the ante for what a great >idea it is to make some Python training Videos/DVD/CBT. > >Go to Barnes and Noble for example, there are precious few python books >visible and they are scattered around in odd corners. This is sad but not >surprising since the Python booklist has grown well over the past year. I >fear the situation may not change much in the future unless there is >widespread adoption of Python ++ big marketing push to make it happen like >WROX, MS, QuickStart, EASYthisEasyTHAT. Even if a newbie cannot afford the >stack of $40+ dollar books VB and others tout, at least they can hang out >their for an afternoon and browse and read and scan the range of uses, >abuses, approaches and devotions of all those authors. Python is slim but >elegantly represented. > >Yes the online docs are admirable, but believe me there are many beginners >who need all the help they can to get going. What are you going to recommend >to the nearest 12-year old who is itching to learn some programming? >RealBASIC, Python, VB, JavaScript, C, C++, Dflat, Rebol, HTML, DHTML, XML, >GML, Lingo, LegoMindstorms... ??? > >My answer is: >1. Start with Macromedia Flash5 and maybe LegoMindstorms for Xmas >2. And then learn Python... [but what am I going to give them for help?] >3. Then Blender v2.x [gaming version with python scripting >http://www.blender.nl] > >Flash it turns out is a brilliant intro to object-oriented programming and a >ton of instant fun for all ages also. >The new Flash5 has a real language in it now [ActionScript = Java/ECMAScript >syntax] behind a cool multi-dimensional interface and frees humans from >most >of all the ghastly invisible stuff which object-oriented programming was >supposed to.. >TEST A: - try making an interface in Flash and then in Tkinter or wxPython >or some such..yeooow!@#. the difference is newbie heaven and hell >TEST B: - or Next time anyone you know has to make PowerPoint slides, crack >open a version of Flash and try that instead. Immediately it makes one think >in terms of sequence, rhythm, flow, aesthetics, reusable components.. >perfect >for presenting ideas and teaching. > >C'mon - The question I ask you is what would make a good contents for a >video, and who here would like to work with me [as camera wielding newbie] >to develop some great CBT/Training Videos for Python ? > >CP4E indeed. Before re-inventing yet another language {RIYAL}, how about >first learning how to teach this one? >Python is cool, it has some idiosyncrasies. I love it and hope it continues >to thrive. >regards >- Jason > >________________________________________________________________ >Jason CUNLIFFE = NOMADICS.(Interactive Art and Technology).Design Director > > > > > > > >_______________________________________________ >Edu-sig mailing list >Edu-sig@python.org >http://www.python.org/mailman/listinfo/edu-sig > From pdx4d@teleport.com Fri Sep 15 16:57:18 2000 From: pdx4d@teleport.com (Kirby Urner) Date: Fri, 15 Sep 2000 08:57:18 -0700 Subject: [Edu-sig] OO in K-12 In-Reply-To: <3.0.3.32.20000910090745.00a76860@pop.teleport.com> References: <02jmrskpt2qicgrln7kd9g2hrjjt3l1t77@4ax.com> Message-ID: <3.0.3.32.20000915085718.00a2d100@127.0.0.1> Is anyone aware of a book that does more to elaborate the idea of a class hierarchy with more analogies to biology i.e. to taxonomy (the "tree of life" in the sense of branching phyla, species etc.). I found at least one URL making the link, but it's not developed: http://www.cis.ufl.edu/~jnw/CIS4930/Lectures/l13.html (see bottom of page). More likely, given the engineering focus, we're going to see a fax machine as a subclass of the more generic telephone. I have nothing against the more mechnical metaphors for a class hierarchy, but I'm always looking for ways to better integrate the curriculum (like, kids are going to be studying biology _anyway_ -- or I hope so), and so it might be useful to talk about how chordata (animals with backbones) have these spinal chord related properties and methods in common (send nerve impulse down chord to branch A). You could say that the evolutionary processes are effective at subclassing plants and animals to fit available ecosystemic niches. This is a useful way of talking about the difference between classes and objects, as well. You have the class Tarantula, which is the generic blueprint, and then all the actual instantiations of that class: the gazillions of tarantulas hanging out in banana bunches or wherever. The instantiations are the actual creepy-crawlies, with their own on-board instance variables (e.g. the internal states of one creepy- crawly versus another's -- size, age also being instance variables). I think that silly simulation I did, of a little ecosystem of "animal objects" fits in here: http://www.python.org/pipermail/edu-sig/2000-April/000306.html Kirby From pdx4d@teleport.com Fri Sep 15 16:42:25 2000 From: pdx4d@teleport.com (Kirby Urner) Date: Fri, 15 Sep 2000 08:42:25 -0700 Subject: [Edu-sig] Re: reducing fractions In-Reply-To: <3.0.6.32.20000915111450.009b57d0@pop.pacificnet.net> References: <7j2qmsstdgrh66sf625eeekqgt7jdn7gh7@4ax.com> Message-ID: <3.0.3.32.20000915084225.00a32c90@127.0.0.1> >> 150/210 -> (3 x 5 x 2 x 5) / (7 x 3 x 2 x 5) -> 5/7 > >That's how my 7th grade teacher taught me to simplify fractions, and I've >never been sorry. > >Steve Litt >Webmaster, Troubleshooters.Com >http://www.troubleshooters.com >slitt@troubleshooters.com Yeah, it's a good way, especially because it builds on the prime vs. composite distinction (composites -> prime factors, somewhat akin to compounds -> elements). I have a Python routine called primes.getfactors() which spits out the prime factors of a composite (within a limited domain -- "cracking numbers" like this isn't easy when the numbers get huge, a fact on which cryptography builds). >>> from primes import getfactors, intersection >>> getfactors(150) >>> list1 = getfactors(150) >>> list1 [2, 3, 5, 5] >>> list2 = getfactors(210) >>> list2 [2, 3, 5, 7] >>> incommon = intersection(list1,list2) >>> incommon # find what nos both lists have in common [2, 3, 5] >>> import operator >>> gcdnumb = reduce(operator.mul,incommon) # take the product >>> gcdnumb # this is the greatest common divisor (gcd) 30 Dividing by the gcd is how to make your numerator and denominator relatively prime. Of course, once in gcd territory, you're in a position to discuss a classic algorithm, dwelt on my Knuth in his famous 'The Art of Computer Programming' (multi-volume). This is called "Euclid's Algorithm" though it may predate Euclid, and is easily written in Python as follows: def gcd(a,b): """Return greatest common divisor using Euclid's Algorithm.""" while b: a, b = b, a % b return a >>> gcd(150, 210) 30 The way this works is it tries to divide a by b, and if it gets a remainder r, then it looks for a gcd for b and r. In other words, you need a more "fine grained" number that'll brick-fill a line of length b, _and_ the leftover r, in which case it'll be a divisor of the original a as well. If dividing r into b leaves a remainder r1, then you're looking for gcd(r,r1) and so on -- this thing could also be written recursively: >>> def newgcd(a,b): """Return greatest common divisor using Euclid's Algorithm.""" if b == 0: return a return newgcd(b,a%b) >>> newgcd(210,150) 30 Combined with the big integer class, such algorithms can be used to manage fractions in such a way that numerator and denominators remain distinct, and all computations result in (long int)/(long int) type fractions (some languages handle this natively, but in Python you can write the class -- as some folks have done and placed on the net for free download). Kirby From asiegel@eico.com Fri Sep 15 18:22:59 2000 From: asiegel@eico.com (asiegel@eico.com) Date: Fri, 15 Sep 2000 12:22:59 -0500 Subject: [Edu-sig] OO in K-12 Message-ID: <0012D942.N22121@eico.com> At the considerablel risk of sounding one note - Look, for example, at O'Reilly's Java in a NutShell. Java's OO is introduced via geometric objects. A drawable circle, inheriting from an abstract circle, if I remember correctly. The beauty being you then see the object you created, as an object as you created it, etc and etc. I might have mentioned (ha-ha) that I worked up something called PyGeo that tried to build on this approach. Why doesn't the concept work for you? . From jasonic@nomadicsltd.com Fri Sep 15 19:02:42 2000 From: jasonic@nomadicsltd.com (Jason Cunliffe) Date: Fri, 15 Sep 2000 14:02:42 -0400 Subject: [Edu-sig] CP4E VideoPython learning to teatch / teaching to learn ..[xpost: was {'cpl',"don't laugh"}] References: <3.0.6.32.20000915113630.008a7d50@pop.pacificnet.net> Message-ID: <003d01c01f3f$25938740$c3090740@megapathdsl.net> Hi Steve Thanks for your kind reply.. ----- Original Message ----- From: Steve Litt To: Sent: Friday, September 15, 2000 11:36 AM Subject: Re: [Edu-sig] CP4E VideoPython learning to teatch / teaching to learn ..[xpost: was {'cpl',"don't laugh"}] > You might be pleasantly surprised running Python under Linux instead of > Windows. All that registry and autoexec stuff goes away. I've never used > Python under Windows, but I bet some of your frustrations were Windows > based, not necessarily Python based. I used to use Activestate Perl under > Windows, and it was really quirky. Perl under Linux does exactly what it's > supposed to (or at least as predictably as a "pathetically eclectic rubbish > lister" can be). Yes I agree some problems no doubt are Windows related. But that is my reality and others too. I do a lot of graphics and multimedia work, use a lot of applications which are not unfortunately available yet on Linux, and though I am very interested in the OS, I am even more interested in the applications and my files. I like Python very much because it is so portable. I really want to put it to that test and become adept with it on any platform. Boa and wxPython for example. Zope and Python External Methods for another.. About 3 months ago I did take a few days out, my older 233mhz Acer Laptop, cleaned off some space, and installed first Corel then Mandrake 6.5 Linux on it. Worked pretty nice, but I did not have enough disk space :-() and I could not get any modem of Ethernet to work yet with it. rats.. It did motivate me to add some RAM which was the best $100 I spent in a long time. wow what a difference. When I have time I plan to catch up on latest Linux laptop voodoo tips and try again..but I know in reality I have to schedule for several lucid sequential days of backups, re-organizing and logging in online to find just-the-right-info(tm). Plus maybe a new modem / Ethernet card with compatible drivers...arghh. It will be worth it when its all over. I will be wiser.. Maybe I will make this a dedicated Linux Python laptop. Meanwhile a new project this year budgeted me to buy a lovely Sony VAIO F450 which came with Win98se installed right now. Beautiful screen and digitalvideo i/o [iLink= Firewire]. get right to work. Fabulous. There _is_ enough hard disk space to install Linux on the other D: partition but that kills the essential D:drive swap disk you need for any video capture.. a possible solution is invest in a fabulous VST firewire drive. [no budget left for that this year] http://www.vsttech.com/vst/products.nsf/firewirepl?OpenView&Start=1&Count=30 &Expand=1#1 Dream#1 I _wish_ it had an 40Gb internal hard drive plus all the appropriate sounds, graphics, DVD, PCMCIA, iLink and printer drivers. Then I could run VMWARE and have everything virtual below that, Linux, Win32 etc.. But I am in the middle of a project and cannot afford the 2+ weeks it might take to reformat and reinstall a lot of stuff to see IF I can get Linux working satisfactorily on this pretty box. I doubt it will support the graphics properly yet. http://www.vmware.com/ I know it will run, because there is company selling Linux ready installed on these SONY models and I checked out the Linux Laptop pages and newsgroups.. Very close to get it happening but this stuff still takes a lot of time and risk of downtime and reinstalling apps etc.. Dream #2 Put a smooothly running Linux on an external drive connected via SCSI or PCMCIA and be able to use that drive as a free traveling instant Linux in your pocket solution. I am some of the way along towards realizing this dream. I invested in a Bullet Drive Express [$130] + 10Gbdrive http://bondiboard.macpublishing.net/pages/december.98/Reviews.4581.html http://www.igo.com/cgi-bin/ncommerce3/ProductDisplay?prmenbr=1&prrfnbr=19920 &cgrfnbr=63&crpcgnbr=&top_crccgnbr=&bot_crccgnbr= I need a few calm days to get this one properly organized - it is sitting here staring at me right now. Let's see - backup everything on CDROM and/or ORB removable drives - format nonsense - boot partitions.. - figure out how to get it to see: the_list_of_stuff_you_need = [ the CDROM, the DSL, the Ethernet, the graphics display, the touch-pad, the mouse, the standby[ouch] and power management buttons] - then the config install fun begins - : Zope, Python, Python packages, PIL, Blender, FreeGIS, Gimp, POVray, ...[Flash plugins], Email apps.. daemons and PDF viewers etc.. - Yay: now get programming!! Dream#3 shop around and get a cheap new/old generic desktop PC which will not have all these early adopter laptop Linux headaches and just do it from scratch. Dream#4 [to be continued] I like all computing platforms for what they do well, and love to critique them for what they do not. Let's see.. my personal experiences so far have led from: RadioShack Model100[the original laptop 8linesmonochrome300baud], through several charming Amigas to Macintoshes to Sun Sparcs to Silicon Graphics Indigo back to more Macs, and later to Win3.1, Amiga runnning a Mac emulator [outrageous!], WinNT, Win95, Win98, now Linux a little..BeOS, soon a lot more. [have you seen the new Mac emulators http://www.emulators.com/softmac.htm] > You mentioned the following: > >Personally I would love to spend a couple of hours sitting next to an > >experienced Python programmer who could show for example the process of > >putting to together a program, testing it, shaping, how they react to error > >messages, how they sculpt the code, how they might look at the problem a > >couple of ways, how they use the tools, how many windows open, what they > >look > >at.. the real-world rhythm of a few hours in the life of a python program.. > >even better if this was intelligently structured and re-playable with > >examples. It would be nice to have a human being talk and type me through > >some code. > > Are you sure you don't already know that stuff? My experience tells me that > the "how tos" you mention above are language independent (assuming the > language is oop and topdown capable like Python, Perl, Java, C++ (no MFC > please), Delphi and the like). Yes you are partly right here.Hopefully the how-to's in many instances are independent as they should be. Python is clean and interactive enough to allow rapid demonstration and exploration. But as part of the big experiment where I am part observer, part guineapig, part instigator, I do feel that Python is very good language for learning computer programming hands-on. Learning through python, rather than learning python, if you see what I mean. Of course I want to learn python. But I am interested to learn it in a way which goes beyond that. This is the same argument I make for why a 12 year-old could get a great intro to programming using Flash5 or LegoMindstorms. I feel the same way about music software too. For a fascinating example of object-oriented programming download a copy of Tim Thompson's KeyKit: http://nosuch.com/keykit/ Getting one's head around abstract structures is easier for many if there are tangible metaphors like sound or image which provide rapid feedback. So many computer programming tasks or examples are based on real-world problem solving, but in my opinion are not so good for beginners, piping files around, making listboxes and yet another boring little application is ok, but not very inspiring. I suspect music and graphics for many are more motivating and encourage both abstraction and real-world problem solving. This was part of the insightful premise of LOGO after all. hmm..Let's see I am looking for metaphor.. ok You can learn a lot about music sitting with a good piano teacher. you will learn some piano, but the right teacher will use the piano to teach music structure, composition, improvisation, style, etc. As I understand it this is what underlies the CP4E idea and others. > Once you've cleared the basic language-independent programming methodology > hurdle (which you sound like you've already done), the next step is the > language-specific "riffs" that make coding in your language more efficient, > readable and easy. This is what you were discussing with import, > os.getcwd(), os.chdir(), '__dir__','__builtins__', '__doc__', '__name__' to > the mysteriously named, ubiquitous,>but frequently blank files named > __init__.py. Right. riffs is a good way to put it.. > Jason, I think you should write a tutorial on all that stuff. You seem to > have the curiosity and love of programming to do it. Maybe I can help you. > > Steve Thanks for the encouragement. I would love to take you up on the offer. Where are you based and how do you think you can help? best wishes - Jason ________________________________________________________________ Jason CUNLIFFE = NOMADICS.(Interactive Art and Technology).Design Director From jasonic@nomadicsltd.com Fri Sep 15 19:16:49 2000 From: jasonic@nomadicsltd.com (Jason Cunliffe) Date: Fri, 15 Sep 2000 14:16:49 -0400 Subject: [Edu-sig] OO in K-12 References: <02jmrskpt2qicgrln7kd9g2hrjjt3l1t77@4ax.com> <3.0.3.32.20000915085718.00a2d100@127.0.0.1> Message-ID: <004701c01f41$1e012260$c3090740@megapathdsl.net> > Is anyone aware of a book that does more to elaborate the idea > of a class hierarchy with more analogies to biology i.e. to > taxonomy (the "tree of life" in the sense of branching phyla, > species etc.). I found at least one URL making the link, but > it's not developed: http://www.cis.ufl.edu/~jnw/CIS4930/Lectures/l13.html > (see bottom of page). More likely, given the engineering focus, > we're going to see a fax machine as a subclass of the more generic > telephone. Perhaps it is out of date and not 'bio' enough for you, but there was nice 3 volume illustrated set of LOGO books that came out some years ago, where plant forms were in some very nice ways explored.Sorry I dont have refs handy for these. The other is the classic 'Turtle Geometry' which had some great stuff by inference. Turtle Geometry : The Computer As a Medium for Exploring Mathematics (Mit Press Series in Artificial Intelligence) by Harold Abelson, Andrea A. Disessa (Contributor Paperback Reprint edition (September 1986) MIT Press; ISBN: 0262510375 There is so much more that has happened with the past 10 years though. I am sure it is time for a new classic: "Biometry: exploring A-life and ecosystems with object-oriented programming" - Jason From jasonic@nomadicsltd.com Fri Sep 15 19:32:45 2000 From: jasonic@nomadicsltd.com (Jason Cunliffe) Date: Fri, 15 Sep 2000 14:32:45 -0400 Subject: [Edu-sig] OO in K-12 References: <0012D942.N22121@eico.com> Message-ID: <005b01c01f43$580a16e0$c3090740@megapathdsl.net> > At the considerablel risk of sounding one note - > > Look, for example, at O'Reilly's Java in a NutShell. Java's OO is > introduced via geometric objects. A drawable circle, inheriting from > an abstract circle, if I remember correctly. > > The beauty being you then see the object you created, > as an object as you created it, etc and etc. > > I might have mentioned (ha-ha) that I worked up something > called PyGeo that tried to build on this approach. > > Why doesn't the concept work for you? If you are on Win32 there is the lovely FlashObject dll by YiYi Sun. I have been experimenting with it a little in Python. Because SWF itself is intrinsically object-oriented, and has built in time and sequencing, it presumably makes an excellent environemt with broad delivery platform for visualizating and exploring Bio-related ecosystems, or smart-geometry type programming in Python. Plus beautiful graphics with tranpsarency, buttons, sound etc. http://www.geocities.com/yiyisun/ "Bukoo is a package which contains 3 Windows COM Objects to create Flash movie. It is based on Macromedia Flash SDK. The VC++ classes in the SDK is wrapped with COM objects. One can use these objects in Delphi, VB, ASP or any other programming environment that supports Automation Objects to create Flash movie without Flash yet most importantly by your program dynamically." ..There maybe a Java version in the works..'' An further direction for this would may be SVG which keeps it keep its object semantics intact. Being XML-based Python is well suited for the job. A good start is http://www.adobe.com/svg/main.html hth - Jason From pdx4d@teleport.com Fri Sep 15 19:47:40 2000 From: pdx4d@teleport.com (Kirby Urner) Date: Fri, 15 Sep 2000 11:47:40 -0700 Subject: [Edu-sig] OO in K-12 In-Reply-To: <0012D942.N22121@eico.com> Message-ID: <3.0.3.32.20000915114740.008a7880@127.0.0.1> At 12:22 PM 09/15/2000 -0500, you wrote: >At the considerablel risk of sounding one note - > >Look, for example, at O'Reilly's Java in a NutShell. Java's OO is >introduced via geometric objects. A drawable circle, inheriting from >an abstract circle, if I remember correctly. Yes, I have that. Bruce uses a similar approach in 'Thinking in Java' and 'Thinking in C++'. But as per my question, this is another example of NOT using the biological analogy to any significant degree. I'm looking for example texts that DO use this analogy. >The beauty being you then see the object you created, >as an object as you created it, etc and etc. Yes, I use polyhedra for this same purpose -- more difficult and challenging to program than simply circles or squares, but also a lot more fun to play with. >I might have mentioned (ha-ha) that I worked up something >called PyGeo that tried to build on this approach. > >Why doesn't the concept work for you? I have a bias in favor of spatial over planar approaches to geometry [1] -- but then I think PyGeo is/was spatial as well, so that's not a problem at all. I'm not aware of any problems I have with PyGeo (at one time maybe...), nor with the traditional geometric and/or engineering analogies used to introduce OO. It's just that animals have their attraction and I think it might make some lights go on (with insights about _biology_, not just about computer languages), for these connections to be made more explicitly in the curriculum (I'm thinking of younger kids especially). Kirby [1] From: http://www.egroups.com/message/mathpolemica/19 This idea of going Polyhedra -> Plane Geometry instead of the other way around is reflective of my bias in general, which is to go Wholes -> Parts rather than Parts -> Wholes. In the more conventional geometry texts, the polyhedra are always towards the back, plus there's only a rather primitive selection. Most early grades, including Montesorri implementations, rest content with the rectangular prism, cone, sphere, cylinder, triangular prism, cube, pyramid (square based). I consider this an impoverished and artificially dumbed-down initial vocabulary -- plus the K-6 texts hardly ever mention Euler's Law, which I consider a grave omission. From pdx4d@teleport.com Fri Sep 15 19:51:36 2000 From: pdx4d@teleport.com (Kirby Urner) Date: Fri, 15 Sep 2000 11:51:36 -0700 Subject: [Edu-sig] CP4E VideoPython learning to teatch / teaching to learn ..[xpost: was {'cpl',"don't laugh"}] In-Reply-To: <003d01c01f3f$25938740$c3090740@megapathdsl.net> References: <3.0.6.32.20000915113630.008a7d50@pop.pacificnet.net> Message-ID: <3.0.3.32.20000915115136.008ae8b0@127.0.0.1> >This is the same argument I make for why a 12 year-old could get a great >intro to programming using Flash5 or LegoMindstorms. Certainly these could be good learning environments. Python is one namespace among many, in which to absorb a lot of useful abstractions and key concepts. I haven't used LegoMindstorms yet, but I bet there'd be a way to do an API accessible from Python, such that whatever you'd done in that environment could be invoked from within your Python code. Kirby From pdx4d@teleport.com Fri Sep 15 21:06:18 2000 From: pdx4d@teleport.com (Kirby Urner) Date: Fri, 15 Sep 2000 13:06:18 -0700 Subject: [Edu-sig] OO in K-12 In-Reply-To: <005b01c01f43$580a16e0$c3090740@megapathdsl.net> References: <0012D942.N22121@eico.com> Message-ID: <3.0.3.32.20000915130618.00a899c0@127.0.0.1> >An further direction for this would may be SVG which keeps it keep its >object semantics intact. >Being XML-based Python is well suited for the job. >A good start is http://www.adobe.com/svg/main.html > >hth >- Jason Interesting links Jason (re Logo and bioforms/plants as well). I think a more sophisticated studio-centric back end could source a lot of interesting video clips (either as Flash movies, or MPEGs or whatever) that would find their way into the classroom (via Shockwave Plugin, DVD juke box or whatever), a lot of them having Python somehow involved in their production. Building frames of an animation programmatically is something I've worked with a little in both Java and Python. Because Java has its canvas built in, and doesn't require Tkinter, plus has the applet front end, I'm more inclined to use Java than Python when it comes to showing animations directly. However, if I have time to render frames off-line, and package them into runnable animations later (e.g. as AVIs or QuickTimes), then it doesn't matter to me about Python's not having native displayability. In those cases, it's more a matter of having Python write text files which in turn get passed to some kind of rendering engine (e.g. Povray). This is where XML-storable vector graphics come in. You could write Python routines which spit out successive frames of an animation in XML, then render these on another platform and package them for display over the internet (even as JPGs running from within a Java applet). Kirby PS: an example of an animated GIF built using Povray (not mine), see: http://www.inetarena.com/~pdx4d/synergetica/gctrain.html (takes a long time to load -- in general not the best format for movies of this length and complexity). For a lot of geometry cartoons in QuickTime format, check http://www.newciv.org/Synergetic_Geometry/ Here's one of my favorites: http://www.rt66.com/~charhawk/archexjbug.html From slitt@troubleshooters.com Fri Sep 15 21:21:34 2000 From: slitt@troubleshooters.com (Steve Litt) Date: Fri, 15 Sep 2000 16:21:34 -0400 Subject: [Edu-sig] CP4E VideoPython learning to teatch / teaching to learn ..[xpost: was {'cpl',"don't laugh"}] In-Reply-To: <003d01c01f3f$25938740$c3090740@megapathdsl.net> References: <3.0.6.32.20000915113630.008a7d50@pop.pacificnet.net> Message-ID: <3.0.6.32.20000915162134.0099e8e0@pop.pacificnet.net> At 02:02 PM 9/15/00 -0400, you wrote: >Hi Steve >> Jason, I think you should write a tutorial on all that stuff. You seem to >> have the curiosity and love of programming to do it. Maybe I can help you. >> >> Steve > >Thanks for the encouragement. >I would love to take you up on the offer. >Where are you based and how do you think you can help? >best wishes >- Jason Hi Jason, I'm just outside of Orlando Florida. I'm webmaster/content lead of Troubleshooters.Com, and as such, create tutorials constantly. I've also written some chapters in Red Hat Linux Unleashed, and am the main author of Samba Unleashed. The first way I can help is by making sure your tutorial gets seen by many people. Troubleshooters.Com gets about 900 distinct IP visitors per day. The second way I can help is by doing the parts of the tutorial you don't want to. The third way is by getting others involved. I have quite a few Python friends, including one who is writing an outline processor in Python (he can certainly help with the advanced part of the tutorial). Also, I can ask you various questions to prompt you to explore various Python "riffs", and you can ask questions to get me to do the same. I already have a very intro Python tutorial on the 'net at http://www.troubleshooters.com/codecorn/python/pptut.htm. When you see it, you'll notice it's a good foundation but completely ignores the wealth of tools that ship with Python. It's that lack of coverage of the tools in my existing tutorial that first called my attention to your post. Steve From asiegel@eico.com Fri Sep 15 22:15:27 2000 From: asiegel@eico.com (asiegel@eico.com) Date: Fri, 15 Sep 2000 16:15:27 -0500 Subject: [Edu-sig] (no subject) Message-ID: <0012EF76.N22121@eico.com> >>This is the same argument I make for why a 12 year-old could get a great >>intro to programming using Flash5 or LegoMindstorms. >Certainly these could be good learning environments. An essential difference, IMO, being that Python is a real and respected and fully grown-up programming language. Not just an "environment". My take is that for some cross-section of the potential audience, and from a surprisingly early age, that's an essential difference and attraction. To me, its Python or Java (JPython?), at least past elementary school. Saying which of course just reflects my own taste and sensibilities to some extent - since certainly alot has been done with Scheme. Just can't see it myself. And just to re-iterate this sensibilty, I don't believe manipulating (scripting) someone else's multi-megabyte graphically sophisticated app is programming in a very meaningful sense, or whether it is or isn't (maybe that its own thread), not the attraction to kids one might think. Why programmers become programmers, it seems to me, is to become capable of drawing on a blank slate. An introduction to programming should communicate that sense of things, IMO. And yes of course it all becomes matters of degree - and yes we're not talking sending 0's and 1's down the pipe. And yes Kirby my response talked past your question, for which I apologize. ART From jasonic@nomadicsltd.com Sat Sep 16 05:28:33 2000 From: jasonic@nomadicsltd.com (Jason Cunliffe) Date: Sat, 16 Sep 2000 00:28:33 -0400 Subject: [Edu-sig] (no subject) References: <0012EF76.N22121@eico.com> Message-ID: <003b01c01f96$93f5f860$c3090740@megapathdsl.net> Hi Yes very interesting reply.. here's my return take.. > >>This is the same argument I make for why a 12 year-old could get a great > >>intro to programming using Flash5 or LegoMindstorms. > > >Certainly these could be good learning environments. > > An essential difference, IMO, being that Python is a real and respected and > fully grown-up programming language. > > Not just an "environment". > > My take is that for some cross-section of the potential audience, and from a > surprisingly early age, that's an essential difference and attraction. Ok sure I agree that Python has respect and maturity..no problem there. But I am not convinced that the others don't also qualify , merely by different criteria: Mindstorms has some very good programming heritage if you consider the pbForth stuff and the keen minds behind all that. Besides, how many programmers have not been profoundly influenced by playing with even regular plastic Lego as kids, if they thought about it honestly. Who hasn't after all? Flash5 has some pretty serious scripting added to the new version. Have you looked at it? But more importantly, the program itself embodies a lot of very important object orientation ideas. Some are invisible magical, some are explicit. The design logic is everywhere, you cannot touch this program, or make it do stuff without this implicit structural mechanics from getting you into a way of thinking very quickly. But it is one which will carry well, and sit quite comfortably with a lot that is outside this glitzy box. It has taken quite a long development history road to get here, to this point of usefulness, power and simplicity. A lot of software ideas, metaphors, interfaces have gone before. And I think the proof is perhaps in the doing. Play around with it a while and tell me I am wrong. but maybe it will make you nuts - not your style - perhaps because you are way too sophisticated already - carrying other paradigm baggage ? - don't 'get it' yet [no insult intended, but it is more than it seems at first glance or reading about it, it's different] - or simply are not motivated by interactive multimedia - ..Fair enough. What I think is very significant is that the application allows one to create 'symbols' [classes] which are multi-layered multi-framed movies. These are stored in a library and then instances are created when they are placed on the 'stage'. They may be nested inside each other and so on. Scripting allows one to send messages and detect events across the object hierarchy. If you don't get it right it won't work. It teaches precision and above all encourages and rewards reuse of modular objects and instances. But where it can send one's head spinning in new dimensions is that each the idea of time and sequence is embedded through everything one does. Every 'movie clip' symbol one creates has its own timeline. Embed this in a single keyframe of a another parent clip, and you have some very sophisticated behaviors emerging. There is nothing else I can think of which has this kind of thinking so accessible, or which let one start exploring the implications of nested objects each with their own behaviors and events so richly. To get control one has to start learning scripting very quickly.. This is why I think it is great for kids. Unlike almost every other programming language out there you do not have to wade through reams of object code to handle basic interface gui window stuff etc. Why should you? But if you wanted to create your own popup menu, combolistbox etc, you can - and it rapidly makes one appreciate how many little details there are even in a simple one. And especially when you want to generalize it. Check out the examples people have posted at www.flashkit.com under 'movies' or 'tutorials etc, and you will see lots of people sharing widgets, parts, ideas and well illustrated tutorials, ramping up every month towards a kind of traveling gui interactive bazaar. Very impressive grass roots community learning in action. Imagine a classroom doing it with some guidance. Imagine this connected to a Zope server and some kids on the other side of the room hacking python External Methods to drive these cool front end interfaces to handle data i/o so they change dynamically..! The arty ones can lend their talents to look and feel.style. The logical ones can help structure and formalize - how are these parts going to be able to work together? The geeky smarter python ones can do their magic.. The visionaries can dream up outrageous projects to challenge the rest.. What is interesting about flash is it is just like Python contribution sites or Perl or whatever, except that you can start by seeing and playing with the parts. Then you decide if it is what you want download and take it apart to see how it was all done. This has to be a good thing for kids. It lets one focus with the learning the basic relationships of these object. After one has stretched that to its conclusions, kids may indeed want to go further an take the whole thing apart, touch all the minutiae of interfaces and gui.. They would be well prepared already I hope. > To me, its Python or Java (JPython?), at least past elementary school. > > Saying which of course just reflects my own taste and sensibilities to some > extent - since certainly > alot has been done with Scheme. Just can't see it myself. > > And just to re-iterate this sensibilty, I don't believe manipulating > (scripting) someone else's > multi-megabyte graphically sophisticated app is programming in a very > meaningful sense, > or whether it is or isn't (maybe that its own thread), not the attraction to > kids one might think. Well one could use win32com and the FlashObject dll by YiYi Sun: It's only 108kb http://www.geocities.com/yiyisun/bukoo/ Your argument really bothers me because to my mind you\ are denying the reality of almost every programming environment. I argue that we work on modern computers on top a vast pile of complex interrelated functions, libraries, dependencies and multi-megabyte applications. From the operating system all the way through - forever. Even blessed Python. Look when you download some this big thing, you uncompress it and out come spilling all those 'magic' files and folders. And every other application is the same. short of the most stripped down cgipython.exe or some such, there is not much difference. Python represents the collaborate effort of many smart people over 10 years. What's wrong with that? nothing.. Flash or Mindstorms, or whatever, are the same, though arguably in varying degrees of quality or concerted open group collaboration. > Why programmers become programmers, it seems to me, is to become capable of > drawing on a blank slate. What is the blank slate.. no keyboard, noOS, no mouse, no printer, no floppy, no ethernet....? Linux 1991 ? C'mon it's a monumental group effort which has gotten us to where we are, [even if it is all wrong as Don Norman clams in 'The Invisible Computer'].. it works but it's always all fragile as all hell. Create a semantic digital sandbox, which is large and stable enough like Python, and more wonders can and do emerge. But let's not ever lose sight of what the illusion is, or what a huge thing base it sits upon. The advantage of an application like Flash for kids is that itself is well defined and stable. It has determined documented limits.. what can you do within it. when you have pushed that to its limits move on to something better. So why am I ranting on and on here in Python Edu-Sig list about Flash? Because what is missing and what I really wish is for a Python-based Flash. It may not be necessary, maybe just showing how to interface the real world available tools like Python and Flash etc is the best way to teach kids. Maybe create a sort of super-Alice. Is this not already happening..? What can Alice learn from Flash and vice-versa? What about scripting Blender..? Python __is__ a nicer language. Has a great community etc. is richer, more mature.. But try doing what Flash does in Python is a hell of challenge. It would be the killer demo. Maybe with Boa to help and some serious training months working playing Flash to see what it does do well. ...hmm anyone interested? kind regards - Jason From ajs@ix.netcom.com Sat Sep 16 16:06:39 2000 From: ajs@ix.netcom.com (Arthur Siegel) Date: Sat, 16 Sep 2000 11:06:39 -0400 Subject: [Edu-sig] Around again Message-ID: <000501c01fef$b97d1100$c9e06dd1@oemcomputer> Jason - First thanks for your reply and the information it contains. The Flash lead is something I do intend to pursue. I would not know to give it a serious look were it not for your advocacy - and I expect I will find something of interest for myself, though whether I see it as CP4E relevant is a slightly separate matter to me. >Maybe create a sort of super-Alice. >Is this not already happening..? >What can Alice learn from Flash and vice-versa? Here you're talking to the wrong guy. I am the anti-Alice. Would be sensible of me to leave this as a question of competing and equally valid sensibilities. Can't do it. But don't want to continue to repeat myself. More generally, people in this community are perhaps more technical than I, and first look to a technological solution. That perspective is at its apex at this moment, culturally. So particularly here, I'm quite sure I sound off key. But while I am the anti-Alice, and have tangled almost personally with Guido on the subject, I am a definite pro-Python. I have been of the position that Python itself is the "breakthrough" that was missing. It's here. Now let's stop fretting about technology and start talking about the specifics of curriculum - a decidedly non-technological pursuit, which some folks are in fact pursuing in various creative ways. >What is the blank slate.. no keyboard, noOS, no mouse, no printer, no >floppy, no ethernet....? Linux 1991 ? The answer to me is again Python. Python out-of-the-box is a legimate blank slate starting point because it is in fact a real world, industrial strength programming language, as distributed. There is no theoretical justification for this as a dividing line. It's just real world, and education is (should be) real world. I don't know it you were around for it: A thirty line Python chat program was posted up by David Scherer. Meaty. Annotated well - semester 1 curriculum finished. The most interesting question surrounding CP4E to me at the moment is the business decision to back-burner CP4E. The world of business is one in which I am not a beginner. I can't say for sure, certainly. Don't have enough of the background or facts. But on the surface I question it, simply as a business decision. Educational spending I think is an X% of the economy that dwarfs much else. Python is looking for unique niches. Among the answers to what you can do with Python that you can't do with Perl and C++, is learn it. Great niche. Whom do I call? From pdx4d@teleport.com Sat Sep 16 17:41:17 2000 From: pdx4d@teleport.com (Kirby Urner) Date: Sat, 16 Sep 2000 09:41:17 -0700 Subject: [Edu-sig] Around again In-Reply-To: <000501c01fef$b97d1100$c9e06dd1@oemcomputer> Message-ID: <3.0.3.32.20000916094117.009c18d0@127.0.0.1> Jason, thanks for the Flash5 info. I'm very interested in getting into a package like that and exploring. I'm a newbie in that domain, and have never been clear on the relationship between Flash and MacroMind Director (I have an old version of the latter, but have never used it). Art, I think your bias is useful and resonates with a lot of programmers, even though Jason is correct that an OS itself is already a multimegabyte, graphically endowed app (unless we go with preGUI OS). But your criteria also apply: Python is general purpose. On the other hand, it's often used as a "glue language" in the real world, getting between mega-apps in not so sexy ways. It even gets pressed into service as a simple shell language. Students of Python should appreciate this versatility, plus realize it's not always the best tool for the job (no language always is). What I don't want to see us waste a lot of time on is re being pro- or anti- this or that, engaging in heated discussions, when the reality is, all these avenues will continue to be explored, regardless of what we do. Like, we can argue forever whether snow is better than wind, or mountains better than the beach -- but what impact will any of this have on the real world? Zero. Rather, I think we should agree on a map or simulation of the relevant technologies, how they overlap and feed into each other (at least potentially), and then each personally choose which neck of the woods to spend the most time in, to make friendly to others. Like, it's no skin off my nose if Alice or LegoMindStorms develop their respective cult followings. We have some millions if not billions of would-be programmers out there, after all. My spin on CP4E is it's minimally the next step after the mass adoption of calculators, including in math class. The CLI (command line interface) is phasing in at this same level, and the way many students will first interact with Python as via IDLE, using it as a calculator. Then will come * more exploration of built-in data structures (list, tuple, dictionary) * simple function defs (including with file i/o) * defs with loops and other control flow statements * defs saved in a module * defs encapsulated in a class (w/ subclasses) This is also pretty much how Python tutorials progress, and is how classroom teachers will approach it, as they trailblaze lesson plans for their students. As a former high school math teacher and former contributing editor-consultant for McGraw-Hill, I tend to approach Python as an accessible CLI in the math classroom. We don't teach computer programming as an end in itself, but as a means. You program for the same reason you use a calculator, lookup table, CAD application or other tool -- to further your comprehension of various key concepts in the knowledge domain, to get some answers, produce results. We program vectors using Python primarily to better understand vectors, not Python -- and yet we'll inadvertently learn a lot of Python in the process (and a lot about computer languages in general). To me, that's CP4E -- a kind of programming that becomes 2nd nature to most people, as a consequence of their having access to a CLI from an early age. It _doesn't_ mean everyone is interested in becoming a professional programmer who earns a living principally by means of writing code. The world would fall apart if that's what "everybody" was doing. For me, CP4E = Numeracy + Computer Literacy, and there's a real difference between _computer programming for everybody_ and _everybody writes codes for a living_. Kirby From asiegel@eico.com Sat Sep 16 20:00:45 2000 From: asiegel@eico.com (asiegel@eico.com) Date: Sat, 16 Sep 2000 14:00:45 -0500 Subject: [Edu-sig] Re: Around again Message-ID: <00130DD5.N22121@eico.com> Kirby -- As much as I enjoy disagreeing with you, I can't find much of a basis with your post. When I talk about the creative curriculum work being done with Python I certainly have you prominently in mind. (And I of course know you actually agree with the full degree of my polemics, and are just a less disagreeable sort). So I will agree that to the extent my constitution allows it, I will attempt to limit my contriubution to the CP4E list to the question of how,if at all, I might contribute to CP4E, in a way in which I happen to be comfortable. In that spirit - can I ask you to elaborate on your efforts. But beyond curriculum matters, perhaps. In the spirit of the latest phase of Python, what I am particularly interested in at this point is your work viewed as a venture (profit-making or not, not being the point) - and what in the ideal world could I or others interested do to support you in furthering your efforts. ART From pdx4d@teleport.com Sat Sep 16 19:58:45 2000 From: pdx4d@teleport.com (Kirby Urner) Date: Sat, 16 Sep 2000 11:58:45 -0700 Subject: [Edu-sig] Re: Around again In-Reply-To: <00130DD5.N22121@eico.com> Message-ID: <3.0.3.32.20000916115845.009bc100@127.0.0.1> >In that spirit - can I ask you to elaborate on your efforts. But beyond >curriculum matters, perhaps. In the spirit of the latest phase of Python, >what I am particularly interested in at this point is your work viewed >as a venture (profit-making or not, not being the point) - and what in >the ideal world could I or others interested do to support you in >furthering your efforts. > >ART Interesting question (at least to me) -- thanks for asking. Starting with the small and close to home, my 6 year old is starting 1st grade in a public school with a non-traditional design, in that parents like me are expected to volunteer X hours per month, including in the classroom if we feel up to it (and not necessarily in the same classroom as your child). The middle school teacher was, according to my wife, quite pleased to get my letter spelling out my desire/willingness to work with middle schoolers. I also volunteered, in the PS of that letter, to get Python working on one or more iMacs by downloading it off the internet. Schools have a lot invested in Apple technology, so one area in which I'm going to maybe learn more is how to use Python on an iMac. An avenue I've tried, and did not succeed at, was getting on staff with the local Math Learning Center, a non-profit, university-affiliated group (as I recall), that fields trainers in connection with MLC curriculum materials, provides teachers-in-training and teachers-in- service with workshops in how to implement specific products and artifacts. My Nov 1997 memo to the MLC is at http://www.teleport.com/~pdx4d/mlc.html and is still my message in a lot of ways: given the new technologies, smaller consortia of public and private sector interests are in a position to compete with the text book behemoths when it comes to providing age-appropriate curriculum materials. I think Jeff Elkner's project to provide such materials, and to pass through the LiveWires stuff (from the UK) is a case in point; no one needs to wait for McGraw-Hill to come up with its "Python for 10th graders" hard cover offering. I've got a linked page discussing MLC's rebuff of my overtures. One reason I don't make much headway as a curriculum writer, is that, with mass-publishing came a lot of momentum for certain ways of doing curriculum, and teachers are by now accustomed to moving forward in lockstep, with states choosing from a small selection of text books meeting their standards. In the USA, the "math war" gets fought at this level (of setting state standards -- in California especially). This is where to fit that open letter to Secretary Riley in the Washington Post, counter-rhetoric from the NCTM, and lots of nastiness on the AMTE listserv (now shut down). Lots of investments hang in the balance. It's a high stakes battle for hearts and minds. However, given the growing homeschooler movement and also charter schools, along with the private schools, I still have plenty of prospects. One is to team up with Stuart Quimby of Design Science Toys and help him manage a Zope server tying together various product lines with lesson plans (only some of them authored by me). Stu and I have been discussing this (he's in the process of moving his factory and has way too much on his plate for things to develop quickly -- but at least DST is profitable enough to be considering this venture). Mostly, I've envisioned myself in those workshop MLC-stype settings, working with present and future teachers, demonstrating how to use various curriculum materials and artifacts effectively. Vendors and solution providers who stand to gain if educators order their wares would be among those sponsoring my team of presenters. Python would fit into this mix (didn't in 1997 because I was entirely unaware of it back then). Here's a rough picture of what that would look like: http://listserv.acsu.buffalo.edu/cgi-bin/wa?A2=ind9803&L=geodesic&O=T&P=2934 If you have any advice re what steps you think I should take next, I'm all ears. Kirby From jasonic@nomadicsltd.com Sat Sep 16 20:21:44 2000 From: jasonic@nomadicsltd.com (Jason Cunliffe) Date: Sat, 16 Sep 2000 15:21:44 -0400 Subject: [Edu-sig] Re: Around again References: <3.0.3.32.20000916115845.009bc100@127.0.0.1> Message-ID: <005501c02013$5a3d2d00$c3090740@megapathdsl.net> Kirby and Art Great dicussion! lots to consider and respond to.. I am rather preoccupied with some pressing deadlines.. so if you don't hear back from me for a couple of days it is not lack of interest thanks & best wishes - Jason From jasonic@nomadicsltd.com Sun Sep 17 06:56:44 2000 From: jasonic@nomadicsltd.com (Jason Cunliffe) Date: Sun, 17 Sep 2000 01:56:44 -0400 Subject: [Edu-sig] CP4E VideoPython learning to teatch / teaching to learn ..[xpost: was {'cpl',"don't laugh"}] References: <3.0.6.32.20000915113630.008a7d50@pop.pacificnet.net> <3.0.6.32.20000915162134.0099e8e0@pop.pacificnet.net> Message-ID: <008701c0206c$0f7bc3e0$c3090740@megapathdsl.net> Hi Steve > The first way I can help is by making sure your tutorial gets seen by many > people. Troubleshooters.Com gets about 900 distinct IP visitors per day. > The second way I can help is by doing the parts of the tutorial you don't > want to. The third way is by getting others involved. I have quite a few > Python friends, including one who is writing an outline processor in Python > (he can certainly help with the advanced part of the tutorial). Also, I can > ask you various questions to prompt you to explore various Python "riffs", > and you can ask questions to get me to do the same. This are very kind and pragmatic suggestions. Scary too, as it put me on the line - but in a good way. I have never done anything like this, have very limited Python skills -- hmm...in fact good reasons for trying! But I should do some homework, first look again at existing Python tutorials and more, yours included of course. I will definitely need help, but that might provide a good foundation to evoke the spirit of tutorial.. The question prompts would be a good idea. and a Q&A dialogue is a good way to get the ball rolling. > I already have a very intro Python tutorial on the 'net at > http://www.troubleshooters.com/codecorn/python/pptut.htm. When you see it, > you'll notice it's a good foundation but completely ignores the wealth of > tools that ship with Python. It's that lack of coverage of the tools in my > existing tutorial that first called my attention to your post. aha.. its a good start. I have been wondering how one can have python tutorial work on-line in web page for someone who does not even have python installed. In other words Python interpreter in a browser window. Big scale this might be hard to do with rigor, but small scale, within the confines of tutorials it would be great if one could have example code, hit adn get a live response or error back. It should be possible using Zope or JPython or something to pass input to Python and then catch the output and return that. Problem would be to allow people to make their own revisions adn see the effects, how to handle indenting etc.. hmm.Not sure maybe this is crazy.. Any ideas? best wishes - Jason From slitt@troubleshooters.com Sun Sep 17 19:22:18 2000 From: slitt@troubleshooters.com (Steve Litt) Date: Sun, 17 Sep 2000 14:22:18 -0400 Subject: [Edu-sig] CP4E VideoPython learning to teatch / teaching to learn ..[xpost: was {'cpl',"don't laugh"}] In-Reply-To: <008701c0206c$0f7bc3e0$c3090740@megapathdsl.net> References: <3.0.6.32.20000915113630.008a7d50@pop.pacificnet.net> <3.0.6.32.20000915162134.0099e8e0@pop.pacificnet.net> Message-ID: <3.0.6.32.20000917142218.00793b80@pop.pacificnet.net> Hi Jason, At 01:56 AM 9/17/00 -0400, Jason Cunliffe wrote: >Hi Steve > >> The first way I can help is by making sure your tutorial gets seen by many >> people. Troubleshooters.Com gets about 900 distinct IP visitors per day. >> The second way I can help is by doing the parts of the tutorial you don't >> want to. The third way is by getting others involved. I have quite a few >> Python friends, including one who is writing an outline processor in >Python >> (he can certainly help with the advanced part of the tutorial). Also, I >can >> ask you various questions to prompt you to explore various Python "riffs", >> and you can ask questions to get me to do the same. > >This are very kind and pragmatic suggestions. >Scary too, as it put me on the line - but in a good way. >I have never done anything like this, have very limited Python skills -- >hmm...in fact good reasons for trying! I have a technique called "Rapid Learning" that anyone (any adult of normal intelligence) can follow to quickly learn technology. It's basically experimentation based -- it's not rocket science and we all use it. Anyway, it's ideally suited to todays newbie who wants to be tomorrows ninja (and write an authoritative tutorial). I'll discuss it with you offline. >But I should do some homework, first look again at existing Python tutorials >and more, yours included of course. >I will definitely need help, but that might provide a good foundation to >evoke the spirit of tutorial.. >The question prompts would be a good idea. and a Q&A dialogue is a good way >to get the ball rolling. > >> I already have a very intro Python tutorial on the 'net at >> http://www.troubleshooters.com/codecorn/python/pptut.htm. When you see it, >> you'll notice it's a good foundation but completely ignores the wealth of >> tools that ship with Python. It's that lack of coverage of the tools in my >> existing tutorial that first called my attention to your post. > >aha.. its a good start. > >I have been wondering how one can have python tutorial work on-line in web >page for someone who does not even have python installed. >In other words Python interpreter in a browser window. I think that's overkill, especially because the host would get hit with bigtime bandwidth charges (at least compared to a static page). The first section of the tutorial simply explains where to get Python, and how to install it, including .rpm, .deb, and ./configure,make,make install. Also, remember that anyone with any modern Linux distro has it right on their install CD. Always remember that the reader can cut and paste code from web pages right into his editor. > >Big scale this might be hard to do with rigor, but small scale, within the >confines of tutorials it would be great if one could have example code, hit > adn get a live response or error back. It should be possible using >Zope or JPython or something to pass input to Python and then catch the >output and return that. Problem would be to allow people to make their own >revisions adn see the effects, how to handle indenting etc.. >hmm.Not sure maybe this is crazy.. >Any ideas? Like I said, IMHO (and I've been wrong before), the effort spent in the web interface would be much better spent adding content to a static tutorial. I'd envision the tutorial as starting with Python basics (much of which I've already covered), and then have tutorials to cover each major package. Then the question becomes, do we make a subtutorial per package, or do we think of some kewl programs that illustrate packages. And remember, I can probably get some more expertise into this tutorial project. This is beginning to sound like fun. Steve From slitt@troubleshooters.com Sun Sep 17 19:29:12 2000 From: slitt@troubleshooters.com (Steve Litt) Date: Sun, 17 Sep 2000 14:29:12 -0400 Subject: [Edu-sig] Future of CP4E after CNRI? In-Reply-To: References: Message-ID: <3.0.6.32.20000917142912.00a4cc60@pop.pacificnet.net> At 05:36 PM 07/13/2000 -0400, Art Siegel wrote: >Further to my last - > >My grand scheme of course is to found a new school of programming. >There's Extreme Programming. I do Naive Programming. The term "Extreme Programming" (as opposed to the practice it describes) never fails to crack me up. After reading about "Extreme Programming", IMHO it's a very productive and reasonable methodology, but it's not "extreme" at all, and the trades' predelection to call it "extreme" is nothing short of pretentious. To me, the programming of our youth, triple consecutive allnighters, no-design coding, drunk programming, 800 lines per night, assembler TSR programs that run 400K executables at a keystroke -- that was extreme. The thing billed as "Extreme Programming" is in fact quite mild, but probably much more intelligent and productive. Not that this has *anything* to do with the topic at hand (sorry, I couldn't resist). Steve From asiegel@eico.com Thu Sep 21 22:35:59 2000 From: asiegel@eico.com (asiegel@eico.com) Date: Thu, 21 Sep 2000 16:35:59 -0500 Subject: [Edu-sig] (no subject) Message-ID: <0014851D.N22121@eico.com> >>If you have any advice re what steps you think I should take next, >>I'm all ears. IMO, more of what your starting to do with Design Science - hooking up and thinking large - I know you do already. Cunliffe is thinking real large - in ways that sound exciting and consistent with my understanding of your ideas and approach. Are you guys talking? From pdx4d@teleport.com Fri Sep 22 17:33:21 2000 From: pdx4d@teleport.com (Kirby Urner) Date: Fri, 22 Sep 2000 09:33:21 -0700 Subject: [Edu-sig] (no subject) In-Reply-To: <0014851D.N22121@eico.com> Message-ID: <3.0.3.32.20000922093321.00adc100@127.0.0.1> At 04:35 PM 09/21/2000 -0500, you wrote: >>>If you have any advice re what steps you think I should take next, >>>I'm all ears. > >IMO, more of what your starting to do with Design Science - hooking up >and thinking large - I know you do already. Just sent an email to Design Science Toys trying to set up a tentative meeting in New York come early November. >Cunliffe is thinking real large - in ways that sound exciting and consistent >with >my understanding of your ideas and approach. Not sure who is Cunliffe. >Are you guys talking? Nope. Kirby From asiegel@eico.com Fri Sep 22 19:37:53 2000 From: asiegel@eico.com (asiegel@eico.com) Date: Fri, 22 Sep 2000 13:37:53 -0500 Subject: [Edu-sig] hooking up Message-ID: <0014C776.N22121@eico.com> >>Just sent an email to Design Science Toys trying to set up a >>tentative meeting in New York come early November. The frightening possibiltiy of us meeting face-to-face presents itself. When you get to town ask for me. I can hand deliver the t-shirts. Seriously - do let me know if you will be here. >>Not sure who is Cunliffe. Jason, who's been posting on EDU-SIG. You still out there, Jason?? From pdx4d@teleport.com Fri Sep 22 19:04:52 2000 From: pdx4d@teleport.com (Kirby Urner) Date: Fri, 22 Sep 2000 11:04:52 -0700 Subject: [Edu-sig] hooking up In-Reply-To: <0014C776.N22121@eico.com> Message-ID: <3.0.3.32.20000922110452.009b1e30@127.0.0.1> At 01:37 PM 09/22/2000 -0500, asiegel@eico.com wrote: >>>Just sent an email to Design Science Toys trying to set up a >>>tentative meeting in New York come early November. > >The frightening possibiltiy of us meeting face-to-face presents itself. > >When you get to town ask for me. I can hand deliver the t-shirts. > >Seriously - do let me know if you will be here. You in the Big Apple? Pretty sure I'll be near NYU/Union Park on Nov 6th -- plan to stay with Snelsons -- Ken Snelson being a famous artist (I'm his webmaster [1]). If I get my appointment with Stu, I'll probably Amtrak upstate (passed West Point) late afternoon, early evening on that day. I'd be available to meet on the 6th, otherwise on the 8th enroute to Newark, where I'd have a late afternoon plane (this is all as per an itinerary I saved at Travelocity.com -- nothing locked in yet, as I'm waiting to hear from contacts in Washington DC). Kirby [1] http://www.teleport.com/~pdx4d/snelson.html From jasonic@nomadicsltd.com Fri Sep 22 21:35:41 2000 From: jasonic@nomadicsltd.com (Jason Cunliffe) Date: Fri, 22 Sep 2000 16:35:41 -0400 Subject: [Edu-sig] hooking up References: <0014C776.N22121@eico.com> Message-ID: <001101c024d4$ad24a320$c3090740@megapathdsl.net> > You still out there, Jason?? I Hope so :-) busy long bunch of days here.. I would also love to hook up anytime you any/all are in or near NYC: Jason Cunliffe 104 2nd Ave #10 New York NY 10003 tel: 212 387-0682 jasonic@nomadicsltd.com downtown manahattan, corner of E6 and 2ndAve. 3 Subways 7 minutes walk: #6 train to Astor Place Broadway N or R trains to 8th Street NYU F train to Second Avenue I may be in Europa late October but should be back by halloween. So early November here in the city would be great.. - Jason [Cunliffe] From pdx4d@teleport.com Fri Sep 22 23:41:57 2000 From: pdx4d@teleport.com (Kirby Urner) Date: Fri, 22 Sep 2000 15:41:57 -0700 Subject: [Edu-sig] hooking up In-Reply-To: <001101c024d4$ad24a320$c3090740@megapathdsl.net> References: <0014C776.N22121@eico.com> Message-ID: <3.0.3.32.20000922154157.007a9750@127.0.0.1> >So early November here in the city would be great.. > >- Jason [Cunliffe] Very good -- maybe can have an edu-sig meeting in NYC on Nov 6. Let's discuss further off-list (unless any others lurking here are interested in this meeting). Kirby PS: I've enhanced my http://www.inetarena.com/~pdx4d/ocn/precalc.html -- another "math through programming" example, this time using Python 2.0 list comprehension and zip() syntax. I'll be posting some more info about it over on calc-reform at the Math Forum. From urner@alumni.Princeton.EDU Sat Sep 23 04:06:20 2000 From: urner@alumni.Princeton.EDU (Kirby Urner) Date: Fri, 22 Sep 2000 20:06:20 -0700 Subject: [Edu-sig] More Pythonic Precalculus (Python 2.0) Message-ID: I posted a follow-up today re Pythonic Precalculus, part of the edu-sig@python.org "math through programming" thread. Also tightened the code some (I'm not a true Python guru, but am learning a lot making these web pages). The whole point is to use zip() and list comprehension, new in Python 2.0 -- so don't expect the code to be backward compatible, cuz it ain't. http://forum.swarthmore.edu/epigone/calc-reform/jigermspon contains some of my chatter. Both of my posts under this heading point to the web page where I show code and graphics together (same look as my 'Numeracy + Computer Literacy' series). Kirby Urner Oregon Curriculum Network From jasonic@nomadicsltd.com Sun Sep 24 19:35:53 2000 From: jasonic@nomadicsltd.com (Jason Cunliffe) Date: Sun, 24 Sep 2000 14:35:53 -0400 Subject: [Edu-sig] Thinking Python - nice lesson Message-ID: <007701c02656$4597e7c0$c3090740@megapathdsl.net> Hello Apologies for cross-posting quotes below, but I don't know how else to discuss it..and you may have missed it. Following is a mini-tutorial reply posted by Michal Wallace on comp.lang.python. I think it is a beautiful python win32com lesson. This picks up the recent thread here about learning Python tutorials, and ways to give a feeling that one is sitting next to a more experienced programmer. Anyway I love his reply because it is practical [solves someone's real problem], but also allows one immediately to step into feeling the process of how to use resources available, and at the python prompt and online to find the answer. Above all it is the tone of real-time learning that's says so much 'betweeen the lines' if you see what I mean.. ok ok whayt I am saying is it is clear aand human thos samll comments of his really do help. This expressiveness, body language signals are easily lost online..in formal translation.. Maybe this seems trivial/obvious to you all...maybe not. Perhaps not your style. Not sure if one should or could do a whole book or series like this. I read it and went "aha!" and so did some others What do you think ? - Jason PS. It reminds me a little of the excellent: 'Thinking Forth' by Leo Brodie which is now back in print.. Paperback 2nd ed edition (1994) Forth Interest Group; ISBN: 0935533001 The first volume was 'Starting Forth' and still out of print, though listed on Amazon. =================================================================== Someone needed to use SSL on win32 with Python. After frustrated by failed attempts he posted to comp.lang.python for help. Tim Peters referred him to read: http://sourceforge.net/bugs/func=detailbug&bug_id=110683&group_id=5470. A pragmatic solution taking advantage of MS internet explorer was offered: "Pedro" wrote : >I've just get involved in a project that needs to fetch some web pages via SSL. I >said : >"ok, no problem. Just let me take my debian box..." . My boss >said this time it will we a WIN32 project: "oops!" (error #1) [snip descriptive list of problems he encountered trying to solve this] Just use the win32com package to automate IE. On Sat, 23 Sep 2000, Pedro wrote: > What module I have to import?. Was looking at the library ref. but found > nothing! you need the win32 extensions, for one thing.. once you have them: - open pythonwin - load the "COM Makepy utility" under the Tools menu - in the window that pops up, double click on: "Microsoft Internet Controls" This generates a magical python module for you.. Now, in the python window, type: >>> from win32com.client import Dispatch >>> ie = Dispatch("InternetExplorer.Application") >>> ie.Visible = 1 At this point, if things are going well, a browser will appear, but will have no content... So.. let's go someplace secure: >>> ie.Navigate("https://secure.authorize.net/") ... Well, it shows up in the browser... But how to get the text? In pythonwin, go to "Tools/COM Browser" "Registered Type Libraries" "Microsoft Internet Controls" "Type Library" "InternetExplorer - CoClass" .. That didn't help... >>> ie Ahh.. "Tools/COM Browser" "Registered Type Libraries" "Microsoft Internet Controls" "Type Library" "IWebBrowser2" Hmmm. That seems to show a bit more info, but we still don't know what to do with it.. Let's go to msdn and see if we can look that control up... Here it is: http://msdn.microsoft.com/workshop/browser/webbrowser/reference/ifaces/IWebB rowser2/IWebBrowser2.asp Looks like we want the "get Document" thing. Back to python. >>> ie.Document Cool! >>> doc = ie.Document According to the MSDN docs, this is just a normal DHTML document object.. >>> doc.url 'https://secure.authorize.net/' >>> print doc.body.innerHTML [it works!] doesn't print the WHOLE HTML document, granted, just the body.. but you can basically script it as if it were client side DHTML because you're using the same engine. You may not need to grab it.. Huh. Anyway, to get rid of it: >>> del doc >>> ie.Quit() Cheers, - Michal ------------------------------------------------------------------------ www.manifestation.com www.sabren.com www.linkwatcher.com www.zike.net ------------------------------------------------------------------------ From pdx4d@teleport.com Mon Sep 25 19:05:48 2000 From: pdx4d@teleport.com (Kirby Urner) Date: Mon, 25 Sep 2000 11:05:48 -0700 Subject: [Edu-sig] More Pythonic Precalculus (Python 2.0) In-Reply-To: Message-ID: <3.0.3.32.20000925110548.03fbc760@pop.teleport.com> Not news to long term Pythoneers I'm sure, but a fun puzzle for me, was how to accept arbitrary algebraic expressions in terms of x as text strings, and then have the expression evaluate for any x. For example: f(x) = 2x^2 + 3x + 10 (x is Real) f(5) = 75 This is the kind of thing school teachers are always looking for -- then you wire the back end to a graphing facility so kids can enter any function and see what it looks like on the Cartesian plane. Here's one solution: >>> import string >>> def mkfunc(rule, x): eq = string.join(string.split(rule,"x"),"(%s)") return eval(eq % ((x,)*eq.count("%s"))) >>> mkfunc("2*x**2 + 3*x + 10",5) 75 If we print intermediate results, you can see more clearly what's going on: >>> mkfunc("2*x**2 + 3*x + 10",5) 2*x**2 + 3*x + 10 # original rule (string) 2*(%s)**2 + 3*(%s) + 10 # (%s) substituted for every x (5, 5) # = (x,)*eq.count("%s") # need a tuple with as many x's as %s's 75 # final result, for x = 5 I've incorporated this result in my camera class at http://www.teleport.com/~pdx4d/precalc.html Works like this: >>> import precalc, from precalc import camera >>> mycam = camera("2*x**2 - 4*x + 3",-3,3,0.1) Where 1st parameter is any rule (as text), then you get start and finish values with step or increment (0.1 in this case). Again, nothing new for long term Pythoneers. Plus it's always easy enough to write your function as a def and pass it in as an object ref -- that's what I do elsewhere in the same module. As usual, I use Povray for my graphical back end, but have some Tk stuff ready (less sophisticated than what's already out there, e.g. by Grayson) for when 2.0b2 comes out (release immanent). Kirby From dustin@cs.uchicago.edu Mon Sep 25 19:15:33 2000 From: dustin@cs.uchicago.edu (Dustin Mitchell) Date: Mon, 25 Sep 2000 13:15:33 -0500 (CDT) Subject: [Edu-sig] More Pythonic Precalculus (Python 2.0) In-Reply-To: <3.0.3.32.20000925110548.03fbc760@pop.teleport.com> Message-ID: Kirby -- How about >>> f = lambda x : 2 * x * x - 10 * x + 2 >>> graph(f) where: def graph(fn): for x in range(-10, 10): print x, fn(x) or the like. *much* cleaner; this is *precisely* what lambda is meant for. Dustin --------------------------------------------------------------------- | Dustin Mitchell )O( | --------------------------------------------------------------------- From pdx4d@teleport.com Mon Sep 25 20:11:52 2000 From: pdx4d@teleport.com (Kirby Urner) Date: Mon, 25 Sep 2000 12:11:52 -0700 Subject: [Edu-sig] More Pythonic Precalculus (Python 2.0) In-Reply-To: References: <3.0.3.32.20000925110548.03fbc760@pop.teleport.com> Message-ID: <3.0.3.32.20000925121152.007a47a0@pop.teleport.com> Actually that's not quite what lambda is meant for as you've gone ahead and named the function anyway (f). So much for lambda providing "anonymous function" capability. Might just as well go: >>> def f(x): return 2 * x * x - 10 * x + 2 >>> graph(f) (which is the approach I take earlier in my precalc.py). One reason to allow text in particular is you might have a front end text box (e.g. in Tk) where students get to freehand their algebraic rule i.e. don't have direct access to the command line interface. Another reason is rules-as -strings are easily save out to file e.g. you could have a text file like: 2*x**2+10*x+3 (x**0.5+x)/(x**2) sin(x**2) ... and read in each line for successive evaluation (the sin string will work if you've done your 'from math import *' earlier. In any case, the challenge before me was to accept algebraic expressions as strings, for whatever reasons. Kirby At 01:15 PM 09/25/2000 -0500, you wrote: >Kirby -- > >How about > >>>> f = lambda x : 2 * x * x - 10 * x + 2 >>>> graph(f) > >where: > >def graph(fn): > for x in range(-10, 10): > print x, fn(x) > >or the like. > >*much* cleaner; this is *precisely* what lambda is meant for. > >Dustin From dscherer@cmu.edu Mon Sep 25 20:18:31 2000 From: dscherer@cmu.edu (David Scherer) Date: Mon, 25 Sep 2000 15:18:31 -0400 Subject: [Edu-sig] More Pythonic Precalculus (Python 2.0) In-Reply-To: <3.0.3.32.20000925121152.007a47a0@pop.teleport.com> Message-ID: > In any case, the challenge before me was to accept algebraic > expressions as strings, for whatever reasons. How about just >>> f = "2 * x**2 - 10*x + 2" >>> eval(f, {'x' : 5}) 2 or def graph(f): for x in range(5): print x, eval(f) or, if you have Numerical Python from Numeric import * x = arange(0,10,1.0) y = eval("2 * x**2 - 10*x + 2") or, if you happen to have VPython handy from visual import * x = arange(-10,10,1.0) f = "2 * x**2 - 10*x + 2" gcurve( x=x, y=eval(f) ) Dave From pdx4d@teleport.com Mon Sep 25 23:29:37 2000 From: pdx4d@teleport.com (Kirby Urner) Date: Mon, 25 Sep 2000 15:29:37 -0700 Subject: [Edu-sig] More Pythonic Precalculus (Python 2.0) In-Reply-To: References: <3.0.3.32.20000925121152.007a47a0@pop.teleport.com> Message-ID: <3.0.3.32.20000925152937.0090bab0@pop.teleport.com> At 03:18 PM 09/25/2000 -0400, David Scherer wrote: >> In any case, the challenge before me was to accept algebraic >> expressions as strings, for whatever reasons. > >How about just > >>>> f = "2 * x**2 - 10*x + 2" >>>> eval(f, {'x' : 5}) >2 Now THIS is I like! I'll upgrade to that with thanks to David Scherer. Kirby From pdx4d@teleport.com Tue Sep 26 03:18:52 2000 From: pdx4d@teleport.com (Kirby Urner) Date: Mon, 25 Sep 2000 19:18:52 -0700 Subject: [Edu-sig] More Pythonic Precalculus (Python 2.0) In-Reply-To: References: <3.0.3.32.20000925110548.03fbc760@pop.teleport.com> Message-ID: <3.0.3.32.20000925191852.00a64c40@pop.teleport.com> At 01:15 PM 09/25/2000 -0500, Dustin Mitchell wrote: >Kirby -- > >How about > >>>> f = lambda x : 2 * x * x - 10 * x + 2 Dustin, re your lambda-based approach, Jeff Cogswell just sent me the following: >>> f = "2 * x**2 - 10 * x + 2" >>> foo = eval("lambda x: %s" % f) >>> for i in range(10): foo(i) 2 -6 -10 -10 -6 2 14 30 50 74 ...which I think is brilliant, and likely faster than even David's solution since it evals only once. Here lambda makes more sense, and we get to start with a string. Kirby PS: there's likely a solution with compile and/or exec as well, but I haven't thought it through. From jasonic@nomadicsltd.com Tue Sep 26 09:52:02 2000 From: jasonic@nomadicsltd.com (Jason Cunliffe) Date: Tue, 26 Sep 2000 04:52:02 -0400 Subject: [Edu-sig] Inspired programming for everyone Message-ID: <001201c02797$0a9ed420$c3090740@megapathdsl.net> Hello For those of you interested in object oriented music programming, one of the best tools around must be Tim Thompson's brilliant KeyKit. http://nosuch.com/keykit/ The user interface system alone is well worth exploring, even if algothmic music is not your bag.. Building on top of this great platform, there is now an extraordinary graphical extension for it by a French artist-programmer called 'Stef'. He has developed GeoMaestro. Good Tutorials in French and English http://perso.infonie.fr/hepta/GM/eGM0.html It would be wonderful if such works of art and science were available for Python. ...shinging singing lights along the path to CP4E... much to learn from here and a symphony of fun enjoy - Jason ________________________________________________________________ Jason CUNLIFFE = NOMADICS.(Interactive Art and Technology).Design Director From jeff@cogswell.net Tue Sep 26 14:29:11 2000 From: jeff@cogswell.net (Jeff Cogswell) Date: Tue, 26 Sep 2000 09:29:11 EDT Subject: [Edu-sig] More Pythonic Precalculus (Python 2.0) Message-ID: Thanks for sharing my tip on the list, Kirby. I think I have things fixed and this email *should* make it to the list now. Jeff >From: Kirby Urner >To: Edu-sig@python.org >Subject: Re: [Edu-sig] More Pythonic Precalculus (Python 2.0) >Date: Mon, 25 Sep 2000 19:18:52 -0700 > > >At 01:15 PM 09/25/2000 -0500, Dustin Mitchell wrote: > >Kirby -- > > > >How about > > > >>>> f = lambda x : 2 * x * x - 10 * x + 2 > >Dustin, re your lambda-based approach, Jeff Cogswell just sent >me the following: > > >>> f = "2 * x**2 - 10 * x + 2" > >>> foo = eval("lambda x: %s" % f) > >>> for i in range(10): foo(i) > >2 >-6 >-10 >-10 >-6 >2 >14 >30 >50 >74 > >...which I think is brilliant, and likely faster than even >David's solution since it evals only once. Here lambda makes >more sense, and we get to start with a string. > >Kirby > >PS: there's likely a solution with compile and/or exec as >well, but I haven't thought it through. > > > >_______________________________________________ >Edu-sig mailing list >Edu-sig@python.org >http://www.python.org/mailman/listinfo/edu-sig _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. Share information about yourself, create your own public profile at http://profiles.msn.com. From dustin@cs.uchicago.edu Tue Sep 26 17:28:43 2000 From: dustin@cs.uchicago.edu (Dustin Mitchell) Date: Tue, 26 Sep 2000 11:28:43 -0500 (CDT) Subject: [Edu-sig] More Pythonic Precalculus (Python 2.0) In-Reply-To: <3.0.3.32.20000925191852.00a64c40@pop.teleport.com> Message-ID: On Mon, 25 Sep 2000, Kirby Urner wrote: > ...which I think is brilliant, and likely faster than even > David's solution since it evals only once. Here lambda makes > more sense, and we get to start with a string. Wow, this really does make sense. Then students don't run into funny business with python syntax, but they still get the benefit of using 'eval'. Dustin --------------------------------------------------------------------- | Dustin Mitchell )O( | --------------------------------------------------------------------- From jpsc@users.sourceforge.net Wed Sep 27 23:18:35 2000 From: jpsc@users.sourceforge.net (JP S-C) Date: Wed, 27 Sep 2000 15:18:35 -0700 (PDT) Subject: [Edu-sig] Python for the Visually Impaired Message-ID: <20000927221835.26496.qmail@web2201.mail.yahoo.com> Dear edu-sig and i18n-sig mailing lists, The subject of this message is somewhere in between education and internationalization, so I am writing you both. I run a project named Ocularis and am interested in collaborating with developers from both SIG's or the SIG's themselves. Ocularis in brief, is a distribution of the Linux Operating System that aims to allow the visually impaired to communicate, work, and express themselves through computers as well as to install and customize their system, independent of sighted assistance. The development of Ocularis is already underway and all software is created by volunteers and is released under the GNU Public License. More detailed information about Ocularis in included below. The ocularis-desktop package (currently in version 0.0.1) focuses on providing console-based applications that serve common functions. This package is written completely in Python, a language which I believe has a lot of potential for creating applications for the visually impaired. In addition, I think that Python is also an ideal language on many fronts, especially when it comes to programming, debugging, and maintaining code non-visually. Other than the ocularis-desktop package, there are also several developers who are working on other subprojects of Ocularis that aim to provide better access to X, including GTK-based applications. I would love to discuss or hear ideas from anyone about Python's many uses for and with the visually impaired. Thank you. --JP Schnapper-Casteras jpsc@users.sourceforge.net Details about Ocularis: The computing environment and suite of applications that are the goal of Ocularis will be free software (see "www.gnu.org" for a definition of free software) and will be based on Linux. The basic applications that Ocularis will possess are a word processor, calendar, calculator, basic accounting or finance application, file manager, Internet browser, and e-mail client. All of these programs will run smoothly on computers consisting of commonly available hardware costing less than $500 that can be bought at almost any local computer store. In comparison to current adaptive technology, this is both a drastic price drop and an increase in the availability of the required hardware. Ocularis was started in response to research on current adaptive technology, which culminated in the editorial "The Potential of Open Source for the Visually Impaired" (available at the Ocularis web site,"http://ocularis.sourceforge.net/"). For more information, please visit the Ocularis web site, "http://ocularis.sourceforge.net/", or contact me directly. __________________________________________________ Do You Yahoo!? Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free! http://photos.yahoo.com/ From urner@alumni.Princeton.EDU Fri Sep 29 01:17:57 2000 From: urner@alumni.Princeton.EDU (Kirby Urner) Date: Thu, 28 Sep 2000 17:17:57 -0700 Subject: [Edu-sig] Tk from IDLE: How to 'Hello World'? Message-ID: Tk in Windows IDLE does not work the way tutorials suggest. For example, consider Fredrik Lundh's 'Hello World' app at http://www.pythonware.com/library/tkinter/introduction/hello-tkinter.htm Writing it interactively in IDLE, one would go: >>> from Tkinter import * >>> def test(): root = Tk() w = Label(root, text="Hello, world!") w.pack() root.mainloop() >>> test() Which gets you the Tk window saying Hello World, as expected. But then if you hit the close box, do you get back to a working IDLE prompt? I don't. I'm left in limbo, with a prompt I can't go back to. I haven't tested this in LINUX IDLE yet, nor in 1.5.2 -- so maybe this is a new phenomenon with the latest beta? Or is it some problem with my setup? Could another Windows user provide a reality check here? Anyway, Lundh's book and many other resources do not appear to be written with IDLE in mind. For example it states: To run the program, run the script as usual: $ python hello1.py But that's not 'usual' for an IDLE user. There's no $ prompt, and we're already in Python, and so wouldn't invoke it. As someone interested in using Python in schools, I think a GUI like IDLE is a potentially better learning environment than a command line in DOS or Xterm. I would like to see more bias in favor of using IDLE when doing work with Tk (IDLE being itself a Tk app, after all, and cross-platform). Kirby From dscherer@cmu.edu Fri Sep 29 02:54:32 2000 From: dscherer@cmu.edu (David Scherer) Date: Thu, 28 Sep 2000 21:54:32 -0400 Subject: [Edu-sig] Tk from IDLE: How to 'Hello World'? In-Reply-To: Message-ID: > Tk in Windows IDLE does not work the way tutorials suggest. > As someone interested in using Python in schools, I think > a GUI like IDLE is a potentially better learning environment > than a command line in DOS or Xterm. I would like to see more > bias in favor of using IDLE when doing work with Tk (IDLE > being itself a Tk app, after all, and cross-platform). "IDLE being itself a Tk app" is part of the problem. Without going into a lot of detail: the commands you type into IDLE are executed in the same process as IDLE itself, so you and IDLE share the same "instance" of Tk. This causes a great number of problems, including the one you observe. There may be workarounds for some of them. The right way to solve this and various other problems is to execute your code in a separate process. Guido and Jeremy planned to make IDLE work that way but never got around to it. I modified the version of IDLE included in VPython to do it, but only for scripts, not for interactive mode. We preferred making it easy for students to write and execute short anonymous scripts to emphasizing interactive mode. It is much easier to correct mistakes in a script (since you can go back and edit it, and then easily run it from the beginning). If anyone wants to add remote execution in interactive mode to IDLE, I suggest joining the idle-dev list and contributing to the IDLE fork at http://sourceforge.net/projects/idlefork. That source tree includes my changes, but I no longer have time to work on it. Dave From pdx4d@teleport.com Fri Sep 29 04:12:51 2000 From: pdx4d@teleport.com (Kirby Urner) Date: Thu, 28 Sep 2000 20:12:51 -0700 Subject: [Edu-sig] Tk from IDLE: How to 'Hello World'? In-Reply-To: References: Message-ID: <3.0.3.32.20000928201251.008d14f0@pop.teleport.com> >If anyone wants to add remote execution in interactive mode to IDLE, I >suggest joining the idle-dev list and contributing to the IDLE fork at >http://sourceforge.net/projects/idlefork. That source tree includes my >changes, but I no longer have time to work on it. > >Dave Thanks for spelling this out Dave. I was wondering if I was pushing the envelope vs. what IDLE is able to handle, and you've confirmed my suspicion. I agree with what you say about scripts (easier to debug and so on), but surely you agree that an intuitive IDLE wouldn't care, i.e. it may be a convenience for the user to do Tk stuff only in scripts, but IDLE itself should at least allow interactive function defs with Tk included. It really should be a user option to enter defs right at the command line. Looking through 'Python and Tkinter Programming', I don't find any of these caveats re IDLE (I'll have to go back and check the Python docs, but I don't recall anything there either). Presumably IDLE is kind of "off to the side" and serious development work doesn't involve using it. But a newbie from Windows world isn't necessarily going to know that, especially given IDLE is bundled and is typically the first thing such a user will see (there's no real incentive to use the DOS box environment, given all that IDLE offers). Likewise in the KDE and GNOME shells: IDLE shows up as an IDE, a development environment, in at least some Linux distros (Mandrake in my case). So I think the literture is deficient in not underscoring this rather important limitation: IDLE is not suitable for doing Tkinter programming. That should be stated clearly and up front, if true, lest too many newbies get disillusioned with the experience of non-working code. I realize that it's more the culture to try to dive in and fix (as you've been doing), vs. to sit around and whine about stuff. Point taken. But it would have been a time saver, for me, to know what wasn't going to work in the first place. I want to give realistic assessments of technologies to educators, and if IDLE isn't useful in some respects, I don't like to always learn the hard way. Fortunately, in this case, I haven't already pushed IDLE + simple Tk scripting as a useful learning environment. I'm sure there's a lot of technical fine points that could be made in this area. I don't want to spread misinformation if I have the wrong idea. Kirby From jasonic@nomadicsltd.com Fri Sep 29 04:58:03 2000 From: jasonic@nomadicsltd.com (Jason Cunliffe) Date: Thu, 28 Sep 2000 23:58:03 -0400 Subject: [Edu-sig] Tk from IDLE: How to 'Hello World'? References: <3.0.3.32.20000928201251.008d14f0@pop.teleport.com> Message-ID: <000d01c029c9$7947fc60$c3090740@megapathdsl.net> Interesting points about IDLE. Thanks for bringing this clearly the surface. I stopped using IDLE some time ago and started using PythonWin, because as a newbie I found more stuff simply worked first time when I tried it .. being a newbie I was not skilled enough to figure out why IDLE was throwing up at me.. PythonWin has the nice Edit Python Path menu which for newbies is also very helpful. It would be even more helpful it is was documented or had an intro tutorial how to use it. But eventually one finds out. PythonWin will not help anyone not working on Win32 of course so there is still a problem. Which leaves TKinter or wxPython-based tools. Boa looks like it be a good cross-platform IDE for Python, since it allows more experienced Programmers to really extend the feature set with widgets and interfaces targeted at various applications. What it lacks perhaps at the moment is stability and focus for this use. It is a sophisticated multifaceted creature. But for education it looks like it might be a better long-term base than IDLE or PythonWin, because one can really build applications with it. And once students get past the basics they can open up the box itself. Install the Boa folder inside Python/tools. click on boa.py and it launches. At the moment it is rather too confusing with a lot if tabs and windows - not a good for day1.. but those might also be configured to be turned off as newbie defaults. any thoughts? - Jason From urner@alumni.Princeton.EDU Fri Sep 29 07:30:40 2000 From: urner@alumni.Princeton.EDU (Kirby Urner) Date: Thu, 28 Sep 2000 23:30:40 -0700 Subject: [Edu-sig] Re: Bug in 2.0b2: Tkinter (continued) References: Message-ID: <41d8tscdf5tjgv58fm4ogf8p1ohpf79pj7@4ax.com> Kirby Urner wrote: > def drawborder(self): > top_l = (self.border,)*2 > top_r = (self.dim - self.border,self.border) > bot_l = (self.border,self.dim - self.border) > bot_r = (self.dim-self.border,)*2 > self.canvas.create_line([(top_l,top_r),(top_r,bot_r),(bot_r,bot_l),(bot_l,top_l)],fill='black') > OK, for one thing, the little border-maker (draws a picture frame around the sine wave) was completely out to lunch. The create_line function just wants to play connect the dots, whereas I was giving it these (vertex,vertex) tuples. So the program was barfing on drawborder. For another thing, as I posted below, someone tells me to do a root.mainloop(1) instead of root.mainloop(), and then the close box will return me to IDLE. Well, that works. With these changes to the code, my tkgraph.py (simple, home grown, not competing with anything at sourceforge) seems pretty stable. Python 2.0b2 (#6, Sep 26 2000, 14:59:21) [MSC 32 bit (Intel)] on win32 Type "copyright", "credits" or "license" for more information. IDLE 0.6 -- press F1 for help >>> import tkgraph >>> tkgraph.testgraph() >>> tkgraph.testgraph() >>> tkgraph.testgraph() >>> tkgraph.testgraph() >>> tkgraph.testgraph() >>> tkgraph.testgraph() >>> tkgraph.testgraph() >>> tkgraph.testgraph() >>> tkgraph.testgraph() >>> tkgraph.testgraph() >>> tkgraph.testgraph() >>> tkgraph.testgraph() >>> tkgraph.testgraph() >>> tkgraph.testgraph() >>> tkgraph.testgraph() >>> tkgraph.testgraph() >>> tkgraph.testgraph() >>> 2+2 4 >>> tkgraph.testgraph() >>> tkgraph.testgraph() >>> tkgraph.testgraph() >>> tkgraph.testgraph() >>> tkgraph.testgraph() >>> tkgraph.testgraph() >>> tkgraph.testgraph() >>> tkgraph.testgraph() >>> tkgraph.testgraph() >>> tkgraph.testgraph() >>> tkgraph.testgraph() >>> tkgraph.testgraph() >>> tkgraph.testgraph() Look ma, no crash! I don't think it was the border glitch that was crashing me before. If you scan back in the postings, I was having trouble with 2.0b1 and Fredrik explained it was garbage collection and variably sized sequences that were to blame -- said it'd be fixed in 2.0b2. So of course I was looking forward to 2.0b2 and disappointed when I got similar kinds of crashes (and before adding the bogus border). So I'm still somewhat mystified as to what I can expect trying to use IDLE as a platform for Tk programming. Dave on edu-sig implies it's not stable. That was my experience, but now I've learned a new trick, squished a bug, and things are working a lot better. I'd appreciate any straight-talkin' jive turkey python guru coming along and spelling it all out for me. Dave seems to really know what he's talking about, so I gather IDLE has limitations as a Tk programming environment -- I just don't yet know when I've hit these limits, and when I'm still fighting my own code and/or ignorance of mainloop(1)-type features. Inquisitively, Kirby PS: Here's the more stable code (not that I expect anyone to run it): # simple graphing from Tkinter import * import math from operator import getitem class graph: def __init__(self,dim=410,border=5): self.dim = dim self.border = border self.scaled = [] self.sf = 0 self.functions = [] def addf(self,function): dom = map(getitem,function,[0]*len(function)) rng = map(getitem,function,[1]*len(function)) maxval = math.ceil(max(map(abs,dom+rng))) self.sf = max(self.sf,(self.dim-self.border*2)/(maxval*2)) self.functions.append(function) def drawgraph(self): self.root = Tk() self.canvas = Canvas(self.root,height=self.dim,width=self.dim, bg='white') self.canvas.pack() self.drawborder() self.plot() self.root.mainloop(1) def drawborder(self): top_l = (self.border,)*2 top_r = (self.dim - self.border,self.border) bot_l = (self.border,self.dim - self.border) bot_r = (self.dim-self.border,)*2 self.canvas.create_line([top_l,top_r,bot_r,bot_l,top_l],fill='black') def plot(self): for graph in self.functions: scaled = self.scaleinput(graph) self.canvas.create_line(scaled, fill='royalblue') def scaleinput(self,graph): dom = map(getitem,graph,[0]*len(graph)) rng = map(getitem,graph,[1]*len(graph)) return zip(map(self.pixel,dom),map(self.pixel,rng)) def pixel(self,val): return int(round(self.sf * val)) + self.border + (self.dim)/2 def testgraph(): dom = mkdomain(-math.pi,math.pi,0.1) # note step by 0.1 sine = zip(dom,[math.sin(x) for x in dom]) # sine function mygraph = graph() mygraph.addf(sine) mygraph.drawgraph() def mkdomain(low, high, interval): # create list of domain values, from low to high # stepping by interval output = [] # the output list i=0 while 1: # just keep looping... (assume parameters ok) output.append(low + i*interval) i=i+1 if output[-1]>=high: break # ...until high reached return output From pdx4d@teleport.com Fri Sep 29 16:28:06 2000 From: pdx4d@teleport.com (Kirby Urner) Date: Fri, 29 Sep 2000 08:28:06 -0700 Subject: [Edu-sig] Tk from IDLE: How to 'Hello World'? Message-ID: <3.0.3.32.20000929082806.00a69ba0@pop.teleport.com> >any thoughts? >- Jason > I've been getting advice to check out Boa from the newsgroup side as well. I've played with wxpython and the Pythonwin interface and didn't have any real problems. I deleted all that stuff when moving up to 2.0. I gather I'd need to go back to 1.5.2 to use these GUI tools, or at least they don't yet work on 2.0 beta. I've got both 1.5.2 and 2.0 in my Linux partition, so could test Boa over there if it's cross-platform (I'm still clumsy/slow in Linux world -- took quite awhile to figure out kpackage well enough to get 2.0/Tk out of the rpms, plus had to go find libreadline.so.3 or something first (still haven't wired Python 2.0 to an icon on my Helix Gnome interface)). Because I'm doing "math through programming" and not really focusing on how to build GUI apps, it wasn't high priority for me to explore Tk. My modules run directly in IDLE and don't depend on any GUI other than IDLE itself to work. But as I'm competing with TI graphing calculators to make Python a CLI of choice in the math classroom, I thought a nice little popup graphing display in Tk should be part of the package. Of course lots of folks have written such (tkgraph, what I was calling my module, is already out there by someone else), but I was taking this opportunity to learn enough Tk myself to pull one off. That's still my agenda. So that's the background. To date, IDLE has served all my needs very well, as my graphics have been out to the Povray rendering engine or to VRML viewers. I've long used some of the Microsoft IDEs for bread and butter programming, including Visual FoxPro's (which is far better than Access/VBA's when it comes to letting you write your own classes, including custom subclasses of the provided widgets -- VFP is way more powerful than Access overall, dunno why Microsoft seems to downplay it). Dragging and dropping widgets/controls from a palette to a form is very easy, then you right click and type in various properties -- the usual thing, what the Java IDEs aim for as well (same as VC++, Delphi, VB, in terms of generic look -- but somewhat different from SmallTalk environments). All of which is to say I know what a fancy IDE is like and see how much time they save when it comes to developing slick front ends that don't look out of place on a desktop (not that I'm strict about that for myself -- that "corporate look" just means "boring" a lot of the time). So if IDLE proves robust enough in 2.0 to accomodate my low intensity use of Tk, then I think I'll be satisfied with it for my little curriculum niche, which points students on to other resources for doing full-fledged GUI apps using Python, or to other languages/IDEs altogether, such as Java or Xbase. Kirby From pdx4d@teleport.com Fri Sep 29 17:13:14 2000 From: pdx4d@teleport.com (Kirby Urner) Date: Fri, 29 Sep 2000 09:13:14 -0700 Subject: [Edu-sig] It's not socket science In-Reply-To: <3.0.3.32.20000929082806.00a69ba0@pop.teleport.com> Message-ID: <3.0.3.32.20000929091314.00a6c7f0@pop.teleport.com> >I've played with wxpython and the Pythonwin interface and didn't >have any real problems. I deleted all that stuff when moving up >to 2.0. Actually, it's all still on my drive, but hasn't been working since installing 2.0. In the past, I've been able to use both Art's PyGeo and the Visual packages. Right now I'm going through Lundh's book, which you can download as an Acrobat file for $12 from Fatbrain. He kindly sent me the source examples this AM, after I asked about 'em -- the book says you can get the code from his web page, but there's no code to be had. What's challenging right off the bat is he uses hyphens in all his module names, so you can't use import blat-blat because hyphens are a no-no. You get around this by going __import__("blat-blat") -- but then I'm still floundering around trying to force a reload... Lundh's book has more of that sockets stuff that gets you out on the internet, which seems to be a hot topic. In the old days, we'd say it's "not rocket science" with "rocket science" presumably representing some pinnacle of difficulty. But the culture has moved on, and I think "it's not socket science" might better capture the mood. Or we could say "Socket science -- NOT!" Kirby From pdx4d@teleport.com Fri Sep 29 17:47:35 2000 From: pdx4d@teleport.com (Kirby Urner) Date: Fri, 29 Sep 2000 09:47:35 -0700 Subject: [Edu-sig] Code Examples using IDLE In-Reply-To: <005901c029f3$87b1c4a0$0900a8c0@SPIFF> References: <3.0.3.32.20000928165631.008017f0@pop.teleport.com> Message-ID: <3.0.3.32.20000929094735.00a6c550@pop.teleport.com> Greetings Fredrik -- No need to respond to this; I know you're super-busy. Just wanted to mention that we IDLE users like to tweak and reload modules quite a bit, including your Standard Library examples. You show how using __import__ directly gets around the fact you use hyphens in your module file names. However, your reload(hello) example doesn't show how to reload with hyphenated modules -- which for IDLE users is the easiest way to force re-evaluation of tweaked code. So for example when I first __import__("socket-example-1"), it executes and gives a server time. If I open this module in IDLE and change the server name, then I'd like to reload and have it execute a second time. I floundered around for awhile and then came up with a way to do it. My solution is to go: >>> v = __import__("socket-example-1") host is: www.python.org server time is Fri Sep 29 09:27:39 2000 local clock is 4 seconds off [change host in source code -- module open in window] >>> reload(v) host is: clock.sgi.com server time is Fri Sep 29 09:41:57 2000 local clock is 2 seconds off [change host in source code -- module open in window] >>> reload(v) host is: ntp-cup.external.hp.com server time is Fri Sep 29 09:43:08 2000 local clock is 2 seconds off I'm using some of the public access time servers listed on: http://www.eecis.udel.edu/~mills/ntp/clock1.htm Perhaps in some future draft of your excellent book, you could throw in a few words for the "IDLE community" (that makes it sound like we're lazy, which I guess in some sense is true). Kirby PS: I notice www.pythonlabs.com is not as friendly to testers: >>> reload(v) Traceback (innermost last): File "", line 1, in ? reload(v) File "G:\PYTHON20\lundh\socket-example-1.py", line 13, in ? s.connect((HOST, PORT)) File "", line 1, in connect error: (10060, 'Operation timed out') Won't even give me the time of day :-( PPS: thanks again for sending source code examples. I'm anticipating hours of fun and games. From RickR@brickroad.net Fri Sep 29 19:40:30 2000 From: RickR@brickroad.net (Rick Richardson) Date: Fri, 29 Sep 2000 11:40:30 -0700 Subject: [Edu-sig] Anyone Explored Stackless python? Message-ID: <1717472437E2D311B90300508B4FB33422FD82@private-client-ip-3.oz.net> has anyone worked with or checked out the stackless python as described here http://www.stackless.com/spcpaper.htm from the looks of things it would have the power to create incredible multi-threaded apps.. which is primarily my interest as I am creating a persistent object server that can glue multiple programs and languages together, acting more like a .dll than a DCOM or CORBA type server, python just seemed like the natural choice because of it's incredible extensibility. If any are interested, I would be more than happy to share it when I am finished, or even discuss design issues. Rick Richardson From dn@picard.sbcc.cc.ca.us Fri Sep 29 22:17:27 2000 From: dn@picard.sbcc.cc.ca.us (Dean Nevins) Date: Fri, 29 Sep 2000 14:17:27 -0700 Subject: [Edu-sig] Teaching Python at a Junior College Level Message-ID: I am a CS teacher who teaches a general service course (both majors and non-majors) and in it we have a programming component. Currently, we are teaching BASIC to the students but I _really_ don't like the bad habits that this language promotes and I like the ease of explaining programming concepts in Python to both CS majors and NON-CS majors. However, my problem is not the language but in trying to get a broader acceptance of Python as a language equivalent to BASIC in people's minds. We know that Python is better ('natch :-) but people responsible for transferring the credit to another school often will ask for BASIC specifically. Any ideas how to fix this problem? This problem is much more important than you might realize. If schools won't accept classes that have Python in them, then it doesn't matter how much better Python is than BASIC, the classes cannot be taught. Either that or you end up with boutique classes with nobody in them. Dean P.S. I'm in California if that matters. From pdx4d@teleport.com Fri Sep 29 23:03:24 2000 From: pdx4d@teleport.com (Kirby Urner) Date: Fri, 29 Sep 2000 15:03:24 -0700 Subject: [Edu-sig] Teaching Python at a Junior College Level In-Reply-To: Message-ID: <3.0.3.32.20000929150324.00a76760@pop.teleport.com> >However, my problem is not the language but in trying to get a broader >acceptance of Python as a language equivalent to BASIC in people's minds. We >know that Python is better ('natch :-) but people responsible for >transferring the credit to another school often will ask for BASIC >specifically. Any ideas how to fix this problem? In my freshman year intro course to computers and programming at Princeton in the 1970s, we sampled several languages: FORTRAN, PL/1, some assembler, SNOBOL and I forget which others. Mostly punch cards, with the CRT experience being new on the IBM 370. When it came to CRTs and a command line interface, Princeton had APL terminals scattered about, with engineering students using APL on Tektronix CRTs for graphics (I'd sometimes sneak in and use 'em at night). Given how easy it is to sample languages (by downloading them for free), perhaps your best bet is to sneak Python into your course without abandoning BASIC. Surely it's easier to talk up the benefits of "compare and contrast" and "not getting stuck in a rut too early" and "different languages for different tasks" and so forth, especially in an intro course. I'd also argue for throwing a LISPish language into the mix -- something like DrScheme, which already has well-developed teaching materials. I suppose it makes some difference whether your course is a sort of vocational track for people headed into programming right away, or a more theoretical track for computer science pros, in which case exposure to lots of languages is essential. There's no such thing as a CS pro who just knows one language -- only vocational programmers might fit that description. >This problem is much more important than you might realize. If schools won't >accept classes that have Python in them, then it doesn't matter how much >better Python is than BASIC, the classes cannot be taught. Either that or >you end up with boutique classes with nobody in them. > >Dean > >P.S. I'm in California if that matters. It would seem extraordinarily closed-minded to say *only* BASIC can be studied in intro courses. I can understand why some exposure to BASIC should be kept, perhaps made mandatory, but I don't understand why a monolingual approach should be enforced early on. Different students will take to different languages and it's best to let them get a sense of the spectrum, the range, rather than ram a single language down their throats. But you probably agree. It's just the dogmatic bureaucrats you have to persuade. Probably your only long term solution is to keep pointing to rising numbers of real world jobs and applications that make use of Python. Kirby PS: I think it's in some ways easier to sneak in Python using in my "math through programming" approach because the focus is the math, aided with whatever tools. As long as they don't think you're teaching programming, you can teach whatever programming you want. From slitt@troubleshooters.com Sat Sep 30 00:21:04 2000 From: slitt@troubleshooters.com (Steve Litt) Date: Fri, 29 Sep 2000 19:21:04 -0400 Subject: [Edu-sig] Teaching Python at a Junior College Level In-Reply-To: Message-ID: <3.0.6.32.20000929192104.00e2ae70@pop.pacificnet.net> At 02:17 PM 9/29/00 -0700, you wrote: >I am a CS teacher who teaches a general service course (both majors and >non-majors) and in it we have a programming component. Currently, we are >teaching BASIC to the students but I _really_ don't like the bad habits that >this language promotes and I like the ease of explaining programming >concepts in Python to both CS majors and NON-CS majors. > >However, my problem is not the language but in trying to get a broader >acceptance of Python as a language equivalent to BASIC in people's minds. We >know that Python is better ('natch :-) but people responsible for >transferring the credit to another school often will ask for BASIC >specifically. Any ideas how to fix this problem? Could you get slick and teach "Basic using Python Design" -- spend 3/4 of the semester doing python, then say OK, here's how you do it in Basic (a window per object HOHO). I'm not an academic guy, but just in case that idea will fly, I'm giving it to you. Steve > >This problem is much more important than you might realize. If schools won't >accept classes that have Python in them, then it doesn't matter how much >better Python is than BASIC, the classes cannot be taught. Either that or >you end up with boutique classes with nobody in them. > >Dean > >P.S. I'm in California if that matters. > > >_______________________________________________ >Edu-sig mailing list >Edu-sig@python.org >http://www.python.org/mailman/listinfo/edu-sig >