From sandysj@juno.com Sat Dec 1 00:06:50 2001 From: sandysj@juno.com (Jeff Sandys) Date: Fri, 30 Nov 2001 16:06:50 -0800 Subject: [Edu-sig] Re: Student Assignment Styles Message-ID: <3C081F1A.F25FB80C@juno.com> Bryce Embry writes: > ... I'm learning a lot of the material as we go along > (I'm a few steps ahead of the students, but not far). > ... > ... I've been using what I consider to be smaller projects and am > wondering if fewer, larger projects would be better for my kids. ... I admire your courage for going ahead with Python without a syllabus, I am still using Logo for middle school students. Since I believe that programming is a craft (not an art or science) we call our after school programming club a Guild. Apprentices learn what the tools are and how to use them. Journeymen work on small projects at my suggestion or as part of a larger project. At this stage they are developing their craft and learning the why of their tools. Once they demonstrate an understanding of programming they become a Master. As a Master they write their own programs and ask teachers if there is something that they could develop for them and their classes, such as a physics simulator or the animal game for understanding classification. All this apprentice, journeyman, master stuff is informal, I don't give tests or allow hazing, the students seem to know what level they are. I strongly encourage the students to work in pairs and teams but allow for loners, who usually will join in the fun later. I'm not sure if this helps, since I volunteer to run this club there is no pressure on me for the students academic performance. Thanks, Jeff Sandys From urnerk@qwest.net Sun Dec 2 05:03:31 2001 From: urnerk@qwest.net (Kirby Urner) Date: Sat, 01 Dec 2001 21:03:31 -0800 Subject: [Edu-sig] Re: [Tutor] Need more precise digits In-Reply-To: <20011201225723.B16876@harmony.cs.rit.edu> References: <4.2.0.58.20011201195017.00c3f5c0@pop3.norton.antivirus> <1007252593.8525.0.camel@rama> <1007252593.8525.0.camel@rama> <20011201204536.B16707@harmony.cs.rit.edu> <4.2.0.58.20011201195017.00c3f5c0@pop3.norton.antivirus> Message-ID: <4.2.0.58.20011201203547.00c3e660@pop3.norton.antivirus> In tutor@python.org, "dman" wrote: >Checking equality with floats is bad because of the >approximations that happen. Oh so true. def lazyrange(start,stop,inc): if (startstop and inc>0): raise ValueError,"Illegal parameters" while start>> genphi = conv([1,1,1,1,1,1,1,1,1,1,1,1,1]) >>> for fraction in genphi: print fraction 0/1 1/0 1/1 2/1 3/2 5/3 8/5 13/8 21/13 34/21 55/34 89/55 144/89 Of course a 'print' statement in place of yield would accomplish the same thing in this context (that's what a yield is like, a print). But I can imagine an application where I'd want to return the partial fraction, then maybe ask for more precision later on, and conv() would be there, ready to pick up right where it left off. I've written class definitions like this for square roots -- you ask for 30 digits of precision, then come back later and ask for 100 digits, and it doesn't have to start over from the beginning, just goes out from 30, and so on. BTW, as some might already know, the constant we're approaching with this simplest of continued fractions is phi = (sqrt(5)+1)/2 = golden ratio = approx. 1.6180339887498949 >>> 144/89. 1.6179775280898876 Not so close yet. But let's go out to 50 iterations: >>> genphi = conv([1 for i in range(50)]) >>> for fraction in genphi: result = fraction >>> result '7778742049/4807526976' >>> 7778742049/4807526976. 1.6180339887498949 Better. This is where we could write a loop that continues until the difference between the fraction and the floating point goes below some very small value, like 1E-12. Just modify conv() to never stop on its own, and keep looping until you hit the break condition, which should *not* involve an ==, for the reason you mention. Kirby From tim.one@home.com Sun Dec 2 09:57:49 2001 From: tim.one@home.com (Tim Peters) Date: Sun, 2 Dec 2001 04:57:49 -0500 Subject: [Edu-sig] RE: [Tutor] Need more precise digits In-Reply-To: <4.2.0.58.20011201203547.00c3e660@pop3.norton.antivirus> Message-ID: [Kirby Urner] > ... > By the way, another application of the generator feature > came up for me on another list recently. I was chatting > with a community college prof about continued fractions, > which have the standard form: > > q0 + 1 > -------- > q1 + 1 > ---- > q2 + .... > > Where q0, q1... are positive integers. I had this recursive > way of doing it which amounted to a right to left evaluation, > but he showed me a way of going left to right. That was cool, > because one thing I wanted to see was how some continued > fractions gradually converge to a key constant. For example, > the simplest of all continued fractions is just: > > 1 + 1 > -------- > 1 + 1 > ---- > 1 + .... > > and so on. Note that the numerators and denominators of the convergents to this are the Fibonacci numbers; that is, this: > ... > 1/1 > 2/1 > 3/2 > 5/3 > 8/5 > 13/8 > 21/13 > ... should look familiar . > The professor had written his algorithm for the TI calculator, > but I adapted with hardly any modifications to Python, and > now it looks like this: > > from __future__ import generators > > def conv(cf): > """ > Generate partial fractions from partial quotients > of a continued fraction, with thanks to: > RWW Taylor > National Technical Institute for the Deaf > Rochester Institute of Technology > Rochester NY 14623 > """ > cfsize = len(cf) > n = [0 for i in range(cfsize+2)] # all 0s Simpler as n = [0] * (cfsize + 2) but, as shown later, you don't need a list here at all. > d = n[:] # copy of n > n[1] = d[0] = 1 > for i in range(cfsize): > n[i+2] = n[i] + cf[i] * n[i + 1] > d[i+2] = d[i] + cf[i] * d[i + 1] > yield str(n[i])+"/"+str(d[i]) # interim result Consider the last iteration of the loop: the n[i+2]/d[i+2] and n[i+1]/d[i+1] convergents are computed but never returned (when i==len(cfsize)-1). > return Not needed -- "falling off the end" of a generator is the same as a "return". > So if I feed this a list like [1,1,1,1,1,1,1,1,1,1,1,1,1], Easier written as [1]*13 (see the similar trick with [0] above). > it'll yield an approximation with each iteration, because > I wrote it as a generator. However, because you compute len(cf) at the start, cf can't *itself* be a generator. It's more flexible (and the code gets simpler!) if you let cf be any iterable object. For example, then you could feed it this: def ones(): while 1: yield 1 That is, an unbounded sequence of ones. > For example: > > >>> genphi = conv([1,1,1,1,1,1,1,1,1,1,1,1,1]) > >>> for fraction in genphi: print fraction > > 0/1 > 1/0 > 1/1 > 2/1 > 3/2 > 5/3 > 8/5 > 13/8 > 21/13 > 34/21 > 55/34 > 89/55 > 144/89 > > Of course a 'print' statement in place of yield would accomplish > the same thing in this context (that's what a yield is like, > a print). But I can imagine an application where I'd want > to return the partial fraction, then maybe ask for more > precision later on, and conv() would be there, ready to pick > up right where it left off. Yes indeed! There are many applications for this, although it's hard to give an obvious example . Here's an alternative that accepts any iterable object (incl. a generator, if you like) as argument, generates all the convergents (including the last two), and doesn't use any internal lists: from __future__ import generators, division # Generate continued-fraction pairs (num, den) from a sequence of # partial quotients. def conv(pqs): x0, y0 = 0, 1 # zero x1, y1 = 1, 0 # infinity yield x0, y0 yield x1, y1 for q in pqs: x0, y0, x1, y1 = x1, y1, x0 + q*x1, y0 + q*y1 yield x1, y1 import math x = (1 + math.sqrt(5))/2 for n, d in conv([1] * 50): approx = n/(d or 1e-300) print "%d/%d ~= %.17g %.17g" % (n, d, approx, x - approx) > ... > This is where we could write a loop that continues until the > difference between the fraction and the floating point goes > below some very small value, like 1E-12. Just modify conv() > to never stop on its own, and keep looping until you hit the > break condition, which should *not* involve an ==, for the > reason you mention. Continued fractions are lovely. One of the things you can prove is that successive convergents are alternately larger and smaller than the true value (e.g., 0/1 < phi, 1/0 > phi, 1/1 < phi, 2/1 > phi, <, >, <, >, ...). Another is that if p/q and r/s are successive convergents, then abs(p/q - r/s) == 1/(q*s) (e.g., 13/8-21/13 == (13*13-21*8)/(8*13) == 1/(8*13)). Together, those imply that the true value is within 1/(q*s) of both convergents. A weaker but more useful relation is that, since the denominators increase once the sequence gets going, the convergent following p/q has a denominator at least as large as q, so the "1/(q*s)" is no larger than 1/q**2. IOW, once you get beyond the trivial convergents at the start, any particular convergent p/q is within 1/q**2 of the true value. This can be used to determine a stopping point good to a given level of accuracy even when you don't know the true value in advance. One other factoid of use: if p/q is a convergent to a real number x, p/q is the best rational approximation to x among all rationals with denominator no greater than q -- although, as usual with continued fraction, that really needs some weasle words to exempt the trivial 0/1 and 1/0 convergents at the start. more-fun-than-apple-pi-ly y'rs - tim From rkr_ii@yahoo.com Sun Dec 2 22:06:02 2001 From: rkr_ii@yahoo.com (Robert Rickenbrode) Date: Sun, 2 Dec 2001 14:06:02 -0800 (PST) Subject: [Edu-sig] Realtimebattle w/ Python Message-ID: <20011202220602.30194.qmail@web13409.mail.yahoo.com> Anyone have any experience using RealTimeBattle (http://realtimebattle.sourceforge.net/) with Python? __________________________________________________ Do You Yahoo!? Buy the perfect holiday gifts at Yahoo! Shopping. http://shopping.yahoo.com From urnerk@qwest.net Mon Dec 3 03:11:59 2001 From: urnerk@qwest.net (Kirby Urner) Date: Sun, 02 Dec 2001 19:11:59 -0800 Subject: [Edu-sig] RE: [Tutor] Need more precise digits In-Reply-To: References: <4.2.0.58.20011201203547.00c3e660@pop3.norton.antivirus> Message-ID: <4.2.0.58.20011202184351.00c5c100@pop3.norton.antivirus> > >more-fun-than-apple-pi-ly y'rs - tim Excellent stuff on continued fractions from our resident math-through-Python (and Python-thru-math) guru Tim Peters. Going the other direction, you might want to take some ordinary fraction p/q, and convert it into a continued fraction, expressed as a list of partial quotients [q0,q1,q2...]. Here's an algorithm for doing that from my algebra.py, based on stuff I'm pretty sure I learned from another good math book: 'Number' by Midhat Gazale. def cfract(a,b): """ Return partial quotients of a regular continued fraction equivalent to a/b""" rcf = [] while b<>0: p = a//b rcf.append(p) b, a = a - p*b, b return rcf It's sort of a modification of the EEA (Euclid's Extended Algorithm). So suppose we want the continued fraction expression of phi, starting from x = (1 + sqrt(5)/2. You can just put the floating point decimal over a big power of 10, and run it through: >>> import algebra, math >>> phi = (1 + math.sqrt(5))/2 >>> phi 1.6180339887498949 >>> 16180339887498949/10000000000000000. 1.6180339887498949 >>> algebra.cfract(16180339887498949,10000000000000000) [1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 10L, 8L, 5L, 37L, 1L, 10L, 1L, 2L, 3L, 3L, 1L, 1L, 1L, 1L, 2L] OK, so it goes off the rails there after awhile, or actually, it doesn't, because this is an exact translation of the above fraction, which isn't phi, but an approximation of phi. Another interesting true fact about continued fractions, is the square root of any natural number will generate a *repeating pattern* of partial quotients. Taking this as a given, we can use the same trick as above to get a handle on what this pattern might be: >>> math.sqrt(3) 1.7320508075688772 >>> algebra.cfract(17320508075688772,10000000000000000)[:15] [1L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L] I truncated the list to 15 elements, knowing it'll diverge from the pattern later, given I'm feeding it an approximation. This is enough to give me the idea. OK, so it looks like I've got a repeating 1,2 pattern, with a 1 up front. I could yield that with a generator, as we've seen: def root3pqs(): yield 1 flipper = 1 while 1: if flipper: yield 1 flipper = 0 else: yield 2 flipper = 1 (that could be made more streamlined I'm sure). Testing: >>> genpqs = root3pqs() >>> [genpqs.next() for i in range(10)] [1, 1, 2, 1, 2, 1, 2, 1, 2, 1] Lookin' good. So now I can use Tim's cf() generator with this generator as input, to get successively more accurate fractional representations of the square root of 3: def conv(pqs): x0, y0 = 0, 1 # zero x1, y1 = 1, 0 # infinity yield x0, y0 yield x1, y1 for q in pqs: x0, y0, x1, y1 = x1, y1, x0 + q*x1, y0 + q*y1 yield x1, y1 >>> genpqs = root3pqs() >>> root3gen = conv(genpqs) >>> root3gen.next() (0, 1) >>> root3gen.next() (1, 0) >>> root3gen.next() (1, 1) >>> root3gen.next() (2, 1) >>> root3gen.next() (5, 3) >>> root3gen.next() (7, 4) >>> for i in range(30): # skip ahead in a hurry val = root3gen.next() >>> val (2642885282L, 1525870529) >>> 2642885282L/1525870529. 1.7320508075688772 >>> math.sqrt(3) 1.7320508075688772 Our fraction is already quite accurate. BTW, I second Tim's recommendation of 'Concrete Mathematics' -- bought it awhile ago on his recommendation and never regretted it, even though I'm not a CS major (philosophy over here). Kirby From python@livewires.org.uk Tue Dec 4 13:35:44 2001 From: python@livewires.org.uk (Paul Wright) Date: Tue, 4 Dec 2001 13:35:44 +0000 (GMT) Subject: [Edu-sig] New release of LiveWires Python Course Message-ID: The LiveWires Python course is intended to teach Python programming to people who have never programmed before. It is used on the LiveWires summer camp to teach 12 to 15 year old children to program. The course consists of a set of PDF worksheets and a Python package. The worksheets and the code are both under BSD-like licences. We've recently produced another release of the course. The major change is a move from Tkinter to Pete Shinners's Pygame package for the games worksheets. This enables us to take advantage of Pygame's fast, cross-platform graphics and sound capabilities. We hope this will make the games worksheets more exciting. You can download the course materials at http://www.livewires.org.uk/python/ Comments or questions relating to the course should be sent to python@livewires.org.uk, which currently points to Paul Wright. From ajs@ix.netcom.com Wed Dec 5 02:05:32 2001 From: ajs@ix.netcom.com (Arthur Siegel) Date: Tue, 4 Dec 2001 21:05:32 -0500 Subject: [Edu-sig] ANN: PyGeo V.6 Message-ID: <000001c17d31$ba0b5960$c747f6d1@ArtSiegel> This is a multi-part message in MIME format. ------=_NextPart_000_0004_01C17D07.690653F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable "Why don't you guys go do some coding!" Fredrik Lundh, python-list, Dec 2, 2001 (quote :approximate, spelling: exact) And so I have. BETTER CODE, REFRESHED SITE http://home.netcom.com/~ajs (check out the animation on the "links" page) =20 NEWS PyGeo is a selected site at the Math Forum=20 http://mathforum.org/library/topics/projective_g >From the PyGeo readme: PyGeo is a 3d Dynamic Geometry toolset, written in Python, with dependencies on Python's Numeric and VPython extensions. It defines a set of geometric primitives in 3d space and allows=20 for the construction of geometric models that can be interactively manipulated, with defined geometric relationships remaining invariant. It was created for, and is therefore particularly suitable for, the visualization of concepts of Projective Geometry. But it can used in more basic ways to create simple constructions illustrating Euclidian principles. And to create colorful designs from geometric ideas. Fun (for all ages) as well as educational for both the mathematically and *artistically* inclined. It is also, hopefully: A take apart toy for folks trying to learn programming A dig at the "Old Dog,New Tricks" adage - having been created by a middle-ager without significant prior programming background. (It took work, it took time) A work-in-process. =20 =20 Art ------=_NextPart_000_0004_01C17D07.690653F0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
"Why don't you guys go do some=20 coding!"
       = Fredrik=20 Lundh,  python-list, Dec 2, 2001
      (quote :approximate, = spelling:=20 exact)
 
And so I have.
 
BETTER CODE, REFRESHED = SITE
 
http://home.netcom.com/~ajs
 
(check out the animation on the "links" = page)
 
NEWS
 
PyGeo is a selected site at the Math = Forum=20
 
http://mathforu= m.org/library/topics/projective_g
 
From the PyGeo readme:
 
PyGeo is a 3d Dynamic Geometry toolset, = written in=20 Python,
with dependencies on Python's Numeric and VPython=20 extensions.
 
It defines a set of geometric = primitives in 3d=20 space and allows
for the construction of geometric models that can = be=20 interactively
manipulated, with defined geometric relationships = remaining=20 invariant.
 
It was created for, and is therefore = particularly=20 suitable for,
the visualization of concepts of Projective=20 Geometry.
 
But it can used in more basic ways to = create simple=20 constructions
illustrating Euclidian principles.
 
And to create colorful designs from = geometric=20 ideas.
 
Fun (for all ages) as well as = educational for both=20 the
mathematically and *artistically* inclined.
 
It is also, hopefully:
 
 A take apart toy for folks trying = to learn=20 programming
 
 A dig at the "Old Dog,New Tricks" = adage -=20 having been created
 by a middle-ager without significant prior=20 programming background.
 (It  took work, it took=20 time)
 
 A work-in-process.
 
 
Art
 
 
------=_NextPart_000_0004_01C17D07.690653F0-- From dustin@cs.uchicago.edu Wed Dec 5 03:26:31 2001 From: dustin@cs.uchicago.edu (Dustin Mitchell) Date: Tue, 4 Dec 2001 21:26:31 -0600 (CST) Subject: [Edu-sig] iBooks in Maine Middle Schools Message-ID: I know this isn't quite Python in education, but I'm curious to hear reaction to this news from Edu-Sig. I'm a 'non-resident Mainer' teaching Middle School in South Carolina (ugh, hot and *no* school funding) right now, so this kinda hits home. http://www.state.me.us/mlte/MLTEcontractawardPR.html http://slashdot.org/article.pl?sid=01/12/03/2043212&mode=nested Reactions? Thoughts? Anyone close to the issue have something to add? Dustin -- Dustin Mitchell dustin@cs.uchicago.edu dustin@ywlcs.org http://people.cs.uchicago.edu/~dustin/ From jason@crash.org Wed Dec 5 03:43:12 2001 From: jason@crash.org (Jason L. Asbahr) Date: Tue, 4 Dec 2001 21:43:12 -0600 Subject: [Edu-sig] iBooks in Maine Middle Schools In-Reply-To: Message-ID: "all seventh grade students and teachers will begin using portable, wireless computers in the Fall of 2002, and all eighth grade students and teachers will be equipped the following year." That's great! I wish my middle school had this when I was a kid. Of course, someone needs to drop a line to their teacher contacts in Maine and make sure those iBooks *are* running Python. ;-) Jason From urnerk@qwest.net Wed Dec 5 16:06:29 2001 From: urnerk@qwest.net (Kirby Urner) Date: Wed, 05 Dec 2001 08:06:29 -0800 Subject: [Edu-sig] iBooks in Maine Middle Schools In-Reply-To: Message-ID: <4.2.0.58.20011205080548.015d8530@pop3.norton.antivirus> > >Reactions? Thoughts? Anyone close to the issue have something to add? > >Dustin So, how well does Python run on an iBook? Kirby From djrassoc01@mindspring.com Thu Dec 6 15:44:03 2001 From: djrassoc01@mindspring.com (Dr. David J. Ritchie, Sr.) Date: Thu, 06 Dec 2001 09:44:03 -0600 Subject: [Edu-sig] Who is teaching Python?? References: <4420476.1007058144616.JavaMail.sainad@sage.edu> Message-ID: <3C0F9242.C04E6504@mindspring.com> Well, I have been teaching Perl to Middle School Students in an after-school, one hour per week computer club setting. I've been doing that since 1998. You can see some discussion of my experiences doing that and the hand-outs on: http://home.mindspring.com/~djrassoc01/ under the "Pearls of Perl" links, the Newsletter links, and the Mars Simulation links. This year I am doing a similar thing but with Python. I have about 12 students in one club now and I expect to have another group beginning in February. The considerations for middle school are definitely different than for college although the college summer students who are part of the Fermilab summer program where I work have benefitted from the "Pearls of Perl" document as they often use Perl in their summer assignments. This relates to the student assignment styles that are being discussed in a different thread as well. It also relates to the importance of the topics being fairly directly connected to other parts of the middle school curriculum which is why our sessions focus on writing Perl (or Python) as a "Language Art" and work toward the students being able by the end of the club sessions to write their own story in Perl or Python in the style of an Adventure Game, Role Playing Game, or Choose Your Own Adventure type story. This integrates the Computer Club sessions into the overall focus of the curriculum around literacy which is a key element of the curriculum at the Middle School level. --David Nora Wirtschafter wrote: > Dear Colleagues, > > I am teaching Python at Widener University, Chester, PA, in CSCI 131, an elective science course for non-computer science majors. > > I am interested in knowing what other colleges, two- or four-year, are using Python as a teaching language. Is Python offered at different levels in the curriculum? Computer Science majors at Widener use C as their beginning language; what language do your CS majors use as a start? I am also interested in what texts you find appropriate (I have developed my own materials.) > > Thank you for any responses. > > Nora W. Wirtschafter, Instructor > Widener University > nww0002@mail.widener.edu -- Dr. David J. Ritchie, Sr. djrassoc01@mindspring.com http://home.mindspring.com/~djrassoc01/ From shannon@centre.edu Thu Dec 6 18:23:42 2001 From: shannon@centre.edu (Christine Shannon) Date: Thu, 06 Dec 2001 13:23:42 -0500 Subject: [Edu-sig] Who is teaching Python References: Message-ID: <3C0FB7AE.F65BE665@centre.edu> This is a multi-part message in MIME format. --------------E2BDCADED0B9D6680AACEDD9 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit At Centre College we have been teaching Python as the first programming language for the past three semesters with very good results. I will be leading a Birds-of-a-Feather session on it at the SIGCSE meeting this year in Northern KY. Our students run the gamut from computer science majors to math and science majors who are taking this for their major to fine arts majors who are exploring. They learn enough about object oriented programming so that those who go on to Data Structures are able to make a good transition to Java. The text book situation is a problem. I have use three different ones so far and have not really been satisfied with any of them. The level is either too elementary or they are written as though this is at least a second programming language for the reader. Most of the on-line documentation is very good but students usually want a book. Christine Shannon --------------E2BDCADED0B9D6680AACEDD9 Content-Type: text/x-vcard; charset=us-ascii; name="shannon.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for Christine Shannon Content-Disposition: attachment; filename="shannon.vcf" begin:vcard n:Shannon;Christine tel;work:859 238 5406 x-mozilla-html:FALSE org:Centre College version:2.1 email;internet:shannon@centre.edu title:Margaret V. Haggin Professor of Science adr;quoted-printable:;;Centre College=0D=0A600 W. Walnut;Danville;KY;40422; x-mozilla-cpt:;-22784 fn:Shannon, Christine end:vcard --------------E2BDCADED0B9D6680AACEDD9-- From urnerk@qwest.net Thu Dec 6 20:25:32 2001 From: urnerk@qwest.net (Kirby Urner) Date: Thu, 06 Dec 2001 12:25:32 -0800 Subject: [Edu-sig] Who is teaching Python In-Reply-To: <3C0FB7AE.F65BE665@centre.edu> References: Message-ID: <4.2.0.58.20011206122345.01e1a700@pop3.norton.antivirus> Hi Christine -- More in the pipeline -- Python teaching texts -- geared towards using with students (I've been reviewing drafts of one of them -- as maybe are others here). You shouldn't have to wait long for some better solutions. And then, of course, there are web sites. I'm skeptical the courses even need text books in this day and age, if one can presume the students have web access (which one can't always presume that of course). Kirby From WHITSTON@ltu.edu Fri Dec 7 16:30:19 2001 From: WHITSTON@ltu.edu (WHITSTON@ltu.edu) Date: Fri, 07 Dec 2001 11:30:19 -0500 (EST) Subject: [Edu-sig] Questions, comments, and other Message-ID: <01KBL24KVB9G94DRLW@LTU.EDU> To all: Question 1: Does Python support relative files directly (the manuals and books I've looked don't address that type of file structure, but that doesn't necessarily mean it can't)? Question 2: One of my students is looking for "curses.py" -- does anyone know where I might find this module (given its name and the fact there is a "curses.h" in C, could I safety assume it is "dead" or at least not in common use any more...)? Comments 1: Python in Schools -- my poster for "Using Python as an Introduction to Programming for Engineering Students" has been accepted for SIGCSE 2002. Comments 2: One of my Senior Project groups is doing their presentation using VPython for "Data Structures and Sorting Algorithms by Visual Means" on Thursday, December 13th at 4:30pm at Lawrence Tech. Univ. (if you are in the Detroit area, you are welcome to attend -- e-mail me for directions and room location) Howard Whitston Lawrence Tech. Univ. whitston@ltu.edu From showell@zipcon.com Fri Dec 7 16:34:56 2001 From: showell@zipcon.com (Steve Howell) Date: Fri, 07 Dec 2001 08:34:56 -0800 Subject: [Edu-sig] Questions, comments, and other References: <01KBL24KVB9G94DRLW@LTU.EDU> Message-ID: <3C10EFB0.71DCE009@zipcon.com> WHITSTON@ltu.edu wrote: > > Question 2: > One of my students is looking for "curses.py" -- does anyone know where I > might find this module (given its name and the fact there is a "curses.h" > in C, could I safety assume it is "dead" or at least not in common use any > more...)? I have used curses.py quite recently on RedHat Linux. I suppose it's more common to find it on a Unix box than on Windows. From pobrien@orbtech.com Fri Dec 7 17:36:41 2001 From: pobrien@orbtech.com (Patrick K. O'Brien) Date: Fri, 7 Dec 2001 11:36:41 -0600 Subject: [Edu-sig] Questions, comments, and other In-Reply-To: <3C10EFB0.71DCE009@zipcon.com> Message-ID: I agree. I'm quite sure it doesn't even install on Windows. --- Patrick K. O'Brien Orbtech.com - Your Source For Python Development Services Phone: 314-963-3206 > -----Original Message----- > From: edu-sig-admin@python.org [mailto:edu-sig-admin@python.org]On > Behalf Of Steve Howell > Sent: Friday, December 07, 2001 10:35 AM > To: WHITSTON@ltu.edu > Cc: EDU-SIG@PYTHON.ORG > Subject: Re: [Edu-sig] Questions, comments, and other > > > WHITSTON@ltu.edu wrote: > > > > Question 2: > > One of my students is looking for "curses.py" -- does anyone > know where I > > might find this module (given its name and the fact there is a > "curses.h" > > in C, could I safety assume it is "dead" or at least not in > common use any > > more...)? > > I have used curses.py quite recently on RedHat Linux. I suppose it's > more common to find it on a Unix box than on Windows. > > _______________________________________________ > Edu-sig mailing list > Edu-sig@python.org > http://mail.python.org/mailman/listinfo/edu-sig From Nora Wirtschafter Fri Dec 7 18:19:24 2001 From: Nora Wirtschafter (Nora Wirtschafter) Date: Fri, 7 Dec 2001 13:19:24 -0500 (EST) Subject: [Edu-sig] Python Teaching Texts for non-computer types Message-ID: <1266860.1007749164178.JavaMail.arnolp@sage.edu> ------=_Part_4935_5136456.1007749164176 Content-Type: text/plain Content-Transfer-Encoding: 7bit Christine -- I, too, had great difficulty in finding a book with the kind of teaching material I want. Therefore, I ended up writing a book that I have now used for three semesters and am pleased with. I'm still in the process of trying to get it published by a major publishing company because the editors feel that there is not a market, and I would prefer not to self publish at this point. My text includes presentation of a concept, then examples (often in a FULL program, not just a program section), review exercises and a number of student programming assignments at the end of each chapter. Concepts build from chapter to chapter, so it really is a teaching text rather than a reference book. It is certainly not an all-inclusive Python tome, but the content is quite teachable in a semester. If I find a publisher who thinks the product is marketable, I will certainly let you know. Nora << Original message attached >> --------------------------------------- Original Email From: Christine Shannon Sent: 12/06/2001 01:23 PM To: edu-sig@python.org Subject: [Edu-sig] Who is teaching Python At Centre College we have been teaching Python as the first programming language for the past three semesters with very good results. I will be leading a Birds-of-a-Feather session on it at the SIGCSE meeting this year in Northern KY. Our students run the gamut from computer science majors to math and science majors who are taking this for their major to fine arts majors who are exploring. They learn enough about object oriented programming so that those who go on to Data Structures are able to make a good transition to Java. The text book situation is a problem. I have use three different ones so far and have not really been satisfied with any of them. The level is either too elementary or they are written as though this is at least a second programming language for the reader. Most of the on-line documentation is very good but students usually want a book. Christine Shannon ------=_Part_4935_5136456.1007749164176-- From arthur.siegel@rsmi.com Fri Dec 7 17:30:46 2001 From: arthur.siegel@rsmi.com (arthur.siegel@rsmi.com) Date: Fri, 7 Dec 2001 12:30:46 -0500 Subject: [Edu-sig] re: Questions, comments, and other Message-ID: Howard writes - >Comments 1: >Python in Schools -- my poster for "Using Python as an Introduction to >Programming for Engineering Students" has been accepted for SIGCSE 2002. Could you elaborate a bit. Is there a public document? I am particularly interested becasue I recently gave a presentation at an engineering university in NY - the math department. That presentation could end up leading to some collaborative work between the CS and math departments there. Python can be a glue language in a new sense in these kinds of environments. Its potential to facilitate interdiscliplinary and interdepartment collaboration is enormously exciting - and quite real, IMO. Art From rkr_ii@yahoo.com Fri Dec 7 21:24:06 2001 From: rkr_ii@yahoo.com (Robert Rickenbrode II) Date: Fri, 07 Dec 2001 16:24:06 -0500 Subject: [Edu-sig] Curses. Message-ID: <5.0.2.1.0.20011207161100.00a586c0@pop.mail.yahoo.com> Hey folks, can someone recommend a curses-like module for Windows? Thanks, Rob Robert K. Rickenbrode II rkr_ii@yahoo.com From liao@sandiego.edu Fri Dec 7 23:17:57 2001 From: liao@sandiego.edu (Luby Liao) Date: Fri, 7 Dec 2001 15:17:57 -0800 Subject: [Edu-sig] Python Teaching Texts for non-computer types In-Reply-To: <1266860.1007749164178.JavaMail.arnolp@sage.edu> References: <1266860.1007749164178.JavaMail.arnolp@sage.edu> Message-ID: <15377.20005.682909.377814@holycow.acusd.edu> Nora, contact Petra at Petra_Recter@prenhall.com. She might be interested. cheers, Luby > Christine -- > > I, too, had great difficulty in finding a book with the kind of teaching material I want. Therefore, I ended up writing a book that I have now used for three semesters and am pleased with. I'm still in the process of trying to get it published by a major publishing company because the editors feel that there is not a market, and I would prefer not to self publish at this point. > > My text includes presentation of a concept, then examples (often in a FULL program, not just a program section), review exercises and a number of student programming assignments at the end of each chapter. Concepts build from chapter to chapter, so it really is a teaching text rather than a reference book. It is certainly not an all-inclusive Python tome, but the content is quite teachable in a semester. > > If I find a publisher who thinks the product is marketable, I will certainly let you know. > > Nora > > > << Original message attached >> > > --------------------------------------- > Original Email > From: Christine Shannon > Sent: 12/06/2001 01:23 PM > To: edu-sig@python.org > Subject: [Edu-sig] Who is teaching Python > > > > At Centre College we have been teaching Python as the first programming > language for the past three semesters with very good results. I will be > leading a Birds-of-a-Feather session on it at the SIGCSE meeting this > year in Northern KY. > > Our students run the gamut from computer science majors to math and > science majors who are taking this for their major to fine arts majors > who are exploring. They learn enough about object oriented programming > so that those who go on to Data Structures are able to make a good > transition to Java. > > The text book situation is a problem. I have use three different ones > so far and have not really been satisfied with any of them. The level > is either too elementary or they are written as though this is at least > a second programming language for the reader. Most of the on-line > documentation is very good but students usually want a book. > > Christine Shannon From sandysj@asme.org Fri Dec 7 22:39:39 2001 From: sandysj@asme.org (Jeff Sandys) Date: Fri, 7 Dec 2001 14:39:39 -0800 (PST) Subject: [Edu-sig] Re: Who is teaching Python In-Reply-To: Message-ID: <20011207223939.81946.qmail@web12802.mail.yahoo.com> Christine Shannon wrote: > > Our students run the gamut ... fine arts majors who are exploring. How was the Python learning experience for the fine arts majors? I remember a neat abstract painting Python applications that was also intended to be used for teaching Python, but I can't find a link for it. Can anyone help? > I have use three different ones so far ... > The level is either too elementary or ... Which 3 books did you use? Kirby Urner wrote: > More in the pipeline -- Python teaching texts -- geared > towards using with students ... Are any of these texts appropriate for middle school students? Thanks, Jeff Sandys __________________________________________________ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com From djrassoc01@mindspring.com Sat Dec 8 01:41:17 2001 From: djrassoc01@mindspring.com (Dr. David J. Ritchie, Sr.) Date: Fri, 07 Dec 2001 19:41:17 -0600 Subject: [Edu-sig] Re: Who is teaching Python References: <20011207223939.81946.qmail@web12802.mail.yahoo.com> Message-ID: <3C116FAB.6BEF66CB@mindspring.com> > > Are any of these texts appropriate for middle school students? > I'm currently doing my computer club unit for 12 middle school kids using Python--writing it as I go--following a similar approach to what I did for Perl--aiming for a "choose your own adventure" literacy target as I did with Perl. I will have another computer club session beginning in February which should let me "classroom test" my initial Python effort in additional ways. --David -- Dr. David J. Ritchie, Sr. djrassoc01@mindspring.com http://home.mindspring.com/~djrassoc01/ From dethe@burningtiger.com Sat Dec 8 22:42:10 2001 From: dethe@burningtiger.com (Dethe Elza) Date: Sat, 08 Dec 2001 14:42:10 -0800 Subject: [Edu-sig] Curses. References: <5.0.2.1.0.20011207161100.00a586c0@pop.mail.yahoo.com> Message-ID: <3C129742.3060607@burningtiger.com> Robert Rickenbrode II wrote: > Hey folks, can someone recommend a curses-like module for Windows? > Thanks, Rob > Robert K. Rickenbrode II > rkr_ii@yahoo.com Cygwin gives windows a unix emulation layer and comes with many (most?) of the standard unix tools, including ncurses. When I work in an environment where I *have* to use windows, this is the first thing I install. http://cygwin.com/ HTH --Dethe -- Dethe Elza (delza@burningtiger.com) Chief Mad Scientist Burning Tiger Technologies (http://burningtiger.com) Living Code Weblog (http://livingcode.ca) From wilson@visi.com Wed Dec 12 13:32:51 2001 From: wilson@visi.com (Timothy Wilson) Date: Wed, 12 Dec 2001 07:32:51 -0600 (CST) Subject: [Edu-sig] Encouraging students to plan effectively Message-ID: Hi everyone, I'm interested in hearing some strategies that I can use for foster good planning on the part of students in my classes. We're just starting our latest project (http://www.isd197.org/sibley/cs/icp/assignments/portfolio_html) and I'm going to have them working in teams of four (a pair of programming pairs). Do you have a formal way of encouraging (enforcing?) a planning process? Does anyone use UML when they get to OOP? (We're not quite there yet.) -Tim -- Tim Wilson | Visit Sibley online: | Check out: Henry Sibley HS | http://www.isd197.org | http://www.zope.com W. St. Paul, MN | | http://slashdot.org wilson@visi.com | | http://linux.com From showell@zipcon.com Wed Dec 12 15:20:27 2001 From: showell@zipcon.com (Steve Howell) Date: Wed, 12 Dec 2001 07:20:27 -0800 Subject: [Edu-sig] Encouraging students to plan effectively References: Message-ID: <3C1775BB.CE841598@zipcon.com> Timothy Wilson wrote: > > Do you have a formal way of encouraging (enforcing?) a planning process? > I would encourage a lightweight planning process, such as writing up a bunch of index cards with tasks and then ordering the index cards according to when tasks should be completed. From jason@crash.org Wed Dec 12 16:18:23 2001 From: jason@crash.org (Jason L. Asbahr) Date: Wed, 12 Dec 2001 10:18:23 -0600 Subject: [Edu-sig] Encouraging students to plan effectively In-Reply-To: <3C1775BB.CE841598@zipcon.com> Message-ID: Great idea, Steve. Using cards is nice and simple. And it is a great way to introduce ideas like "use cases" or "user stories". Here are some references to the usage of cards in the Extreme Programming community: XP Roadmap (intro): http://c2.com/cgi/wiki?ExtremeProgramming Card-specific: http://c2.com/cgi/wiki?WriteItOnaCard User stories: http://c2.com/cgi/wiki?UserStory Also, Timothy, going so far as to actually enforce a planning process would probably backfire. There are intrinsic rewards to various degrees of planning (better code, less frustrating debugging, potential for rapid adaptability to changing customer requirements), but they are not always obvious, especially to beginners. Explicitly *rewarding* ("bonus points") individuals and teams that plan (and plan well) might help ingrain the practice. Up front reward for investing the energy in planning coupled with deferred reward as their projects run with more features and less debugging, yes, I think that might do it. :-) Cheers, Jason -----Original Message----- From: edu-sig-admin@python.org [mailto:edu-sig-admin@python.org]On Behalf Of Steve Howell Sent: Wednesday, December 12, 2001 9:20 AM To: Timothy Wilson Cc: Python-Edu SIG Subject: Re: [Edu-sig] Encouraging students to plan effectively Timothy Wilson wrote: > > Do you have a formal way of encouraging (enforcing?) a planning process? > I would encourage a lightweight planning process, such as writing up a bunch of index cards with tasks and then ordering the index cards according to when tasks should be completed. _______________________________________________ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig From showell@zipcon.com Wed Dec 12 16:35:53 2001 From: showell@zipcon.com (Steve Howell) Date: Wed, 12 Dec 2001 08:35:53 -0800 Subject: [Edu-sig] Encouraging students to plan effectively References: Message-ID: <3C178769.270913E2@zipcon.com> "Jason L. Asbahr" wrote: > > [...] > Also, Timothy, going so far as to actually enforce a planning process > would probably backfire. There are intrinsic rewards to various degrees > of planning (better code, less frustrating debugging, potential for rapid > adaptability to changing customer requirements), but they are not always > obvious, especially to beginners. > > Explicitly *rewarding* ("bonus points") individuals and teams that plan > (and plan well) might help ingrain the practice. Up front reward for > investing the energy in planning coupled with deferred reward as their > projects run with more features and less debugging, yes, I think that > might do it. :-) > Good points. If you have a planning process based on index cards, you can create a tangible reward system for the planning process. After each task is finished, you get to move it from the to-do pile to the done pile. This gets very addictive, even for adults! I've visited a couple real-world programming shops that do Extreme Programming, and they have bulletin boards where they put the cards up, and as the cards get completed, they move the cards to the "done" area of the bulletin board. From sandysj@asme.org Wed Dec 12 19:03:22 2001 From: sandysj@asme.org (Jeff Sandys) Date: Wed, 12 Dec 2001 11:03:22 -0800 (PST) Subject: [Edu-sig] Re: Encouraging students to plan Message-ID: <20011212190322.25339.qmail@web12803.mail.yahoo.com> I have asked the students to do a storyboard frame, a picture and short discription of what the program or sub-program is intended to do. It should list the inputs, outputs and actions. When a student asks me a question the first thing I ask to see is their plan. when advanced students do projects for teachers, I ask them to write a contract, or oppertunity evaluation in P+ terms. This is just an informal statement of what the program should do. Then they do the storyboards. I am currently doing this with Logo and plan to continue using the same process with Python. Thanks, Jeff Sandys __________________________________________________ Do You Yahoo!? Check out Yahoo! Shopping and Yahoo! Auctions for all of your unique holiday gifts! Buy at http://shopping.yahoo.com or bid at http://auctions.yahoo.com From matthias@ccs.neu.edu Thu Dec 13 18:08:10 2001 From: matthias@ccs.neu.edu (Matthias Felleisen) Date: Thu, 13 Dec 2001 13:08:10 -0500 (EST) Subject: [Edu-sig] Encouraging students to plan In-Reply-To: (edu-sig-request@python.org) References: Message-ID: <20011213180810.1D9AF206F3@sualocin.ccs.neu.edu> You may wish to check out "How to Design Programs" (MIT Press 2001, also avalibale at htdp.org). It introduces the notion of a "design recipe" where a teacher can check several intermediate design steps systematically. It's mostly functional but you should be able to adapt it to Python. -- Matthias From wilson@visi.com Sat Dec 15 23:41:03 2001 From: wilson@visi.com (Timothy Wilson) Date: Sat, 15 Dec 2001 17:41:03 -0600 (CST) Subject: [Edu-sig] Encouraging students to plan effectively In-Reply-To: Message-ID: On Wed, 12 Dec 2001, Jason L. Asbahr wrote: > Great idea, Steve. Using cards is nice and simple. And it is a great > way to introduce ideas like "use cases" or "user stories". Thanks to all who offered suggestions. I read "Extreme Programming Installed" over the last couple days and found several things that were interesting. I like the "user story" method of defining the specifications for a project. I'm going to try this. My students are part way through a new Portfolio Tracker assignment (http://www.isd197.org/sibley/cs/icp/assignments/portfolio_html), but I think I'll hand out some user story cards and get them used to the concept. I wrote up another project page at http://www.isd197.org/sibley/cs/icp/assignments/portfolio2_html that emphasizes the user stories. I wonder if any of you would look it over and give me some feedback. Specifically, do the user stories capture the specs adequately? (My project page also includes a PDF of the user stories I'm going to hand out.) -Tim -- Tim Wilson | Visit Sibley online: | Check out: Henry Sibley HS | http://www.isd197.org | http://www.zope.com W. St. Paul, MN | | http://slashdot.org wilson@visi.com | | http://linux.com From djrassoc01@mindspring.com Sun Dec 16 05:30:12 2001 From: djrassoc01@mindspring.com (Dr. David J. Ritchie, Sr.) Date: Sat, 15 Dec 2001 23:30:12 -0600 Subject: [Edu-sig] Encouraging students to plan effectively References: Message-ID: <3C1C3164.E3037D4B@mindspring.com> --------------CC4E4D20FEC1D9520A326ED9 Content-Type: text/plain; charset=us-ascii; x-mac-type="54455854"; x-mac-creator="4D4F5353" Content-Transfer-Encoding: 7bit (I inadvertently sent this to the original poster only -- I meant to send it to the OP and the list so here it is.) In quickly reading your materials, e.g.,, > My students are part way through a new Portfolio Tracker assignment > (http://www.isd197.org/sibley/cs/icp/assignments/portfolio_html), but I > think I'll hand out some user story cards and get them used to the concept. > > I wrote up another project page at > http://www.isd197.org/sibley/cs/icp/assignments/portfolio2_html that > emphasizes the user stories. > etc. I had expected more real "stories" -- i.e. "So, a user walks into a brokerage house and asks..." with the eye on the stories being one to engage the imagination and from the story to distill the requirements. That's kind of what I have done for middle school students with respect to a Mars Voyage Simulation written in Perl (see: http://home.mindspring.com/~djrassoc01/mars/index.html ) though it's not quite the same thing because I was writing the program to fit some requirements of a Mars Space Camp that the students were taking. Still, I tried (for middle school students) to weave a "simulation story" around what I was doing so there would be a natural visualizable way that the programming aspects would fall out and be meaningful to the students rather than seeming to have just been pulled out of thin air. Your students are several years older than mine so it may be that they don't need (as I felt) the more concrete story telling to get their heads into the problem -- in which case the comments are not that relevant. --D. -- Dr. David J. Ritchie, Sr. djrassoc01@mindspring.com http://home.mindspring.com/~djrassoc01/ --------------CC4E4D20FEC1D9520A326ED9 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit (I inadvertently sent this to the original poster only -- I meant to send it to the OP and the list so here it is.)

In quickly reading your materials, e.g.,,

My students are part way through a new Portfolio Tracker assignment
(http://www.isd197.org/sibley/cs/icp/assignments/portfolio_html), but I
think I'll hand out some user story cards and get them used to the concept.

I wrote up another project page at
http://www.isd197.org/sibley/cs/icp/assignments/portfolio2_html that
emphasizes the user stories.


etc. I had expected more real "stories" -- i.e. "So, a user walks into a brokerage house and asks..." with the eye on the stories being one to engage the imagination and from the story to distill the requirements.

That's kind of what I have done for middle school students with respect to a Mars Voyage Simulation written in Perl (see:  http://home.mindspring.com/~djrassoc01/mars/index.html ) though it's not quite the same thing because I was writing the program to fit some requirements of a Mars Space Camp that the students were taking.  Still, I tried (for middle school students) to weave a "simulation story" around what I was doing so there would be a natural visualizable way that the programming aspects would fall out and be meaningful to the students rather than seeming to have just been pulled out of thin air.

Your students are several years older than mine so it may be that they don't need (as I felt) the more concrete story telling to get their heads into the problem -- in which case the comments are not that relevant.

--D.
 

--
Dr. David J. Ritchie, Sr.
djrassoc01@mindspring.com
http://home.mindspring.com/~djrassoc01/
  --------------CC4E4D20FEC1D9520A326ED9-- From rkr_ii@yahoo.com Mon Dec 17 22:19:02 2001 From: rkr_ii@yahoo.com (Robert Rickenbrode) Date: Mon, 17 Dec 2001 14:19:02 -0800 (PST) Subject: [Edu-sig] Python sound. Message-ID: <20011217221902.96369.qmail@web13406.mail.yahoo.com> Hey folks, I'm having the kids use the winsound.Beep library to write programs that play Christmas carols. I had in mind to switch to the Snack wrapper functions to switch to nicer sounding notes that play through the audio card/speakers, but... I seem to be having some trouble getting Snack to play and really don't like the fact that it has to pop-open a root window using Tk (we've not discussed GUIs yet). Does anyone know about either: 1. Another nice windows compatible sound library for python; or, 2. How to get Snack to play notes in series with either the Tk root window closed or minimized? Thanks, Rob __________________________________________________ Do You Yahoo!? Check out Yahoo! Shopping and Yahoo! Auctions for all of your unique holiday gifts! Buy at http://shopping.yahoo.com or bid at http://auctions.yahoo.com From dethe@burningtiger.com Tue Dec 18 18:28:19 2001 From: dethe@burningtiger.com (Dethe Elza) Date: Tue, 18 Dec 2001 10:28:19 -0800 Subject: [Edu-sig] Python sound. References: <20011217221902.96369.qmail@web13406.mail.yahoo.com> Message-ID: <3C1F8AC3.6050400@burningtiger.com> Hi Rob, I've had similar problems with a back-burner project. I want a cross-platform way to create sounds based on a sine wave, but most of the python sound packages seem to be focussed on manipulation and playback of pre-recorded files (.wav, etc.). Here are the options I'm aware of, for what it's worth: Python Multimedia Services (part of standard install): Detect file type, manipulate raw audio data, but no playback http://www.python.org/doc/current/lib/mmedia.html Snack Sound Toolkit Multi-platform, can create, filter, playback, and visualize sound files. Some limited support for synthesizing sounds without playing a file. Requires a Tk window to run it's loop (although I think the window can be hidden?) http://www.speech.kth.se/snack/ Pythonware Sound Toolkit Reads numerous sound formats (AU, VOC, and WAV) and plays them back on a variety of hardware platforms (windows and sun boxen). http://www.pythonware.com/products/pst/index.htm ALPY 3D Sound Toolkit Interface to OpenAL (http://www.openal.org/home/), which is to audio what OpenGL is to graphics. I haven't played with this yet, but it's on my list of things to do. http://amoras.2y.net/alpy/ pygame A game building framework built on top of SDL (http://www.libsdl.org/), which includes sound capabilities. Another one I've been meaning to get around to trying. This appears to have more momentum (developers using it) than ALPY. http://pygame.seul.org/ There are also lots of special-purpose sound libraries for individual platforms (windows, linux, mac) and many (most?) have python bindings. It would be an interesting project to factor out the common features into one python package which worked cross platform and called the correct binary library depending on platform. This isn't something I have time for right now, although I'd be willing to help document it on the Contagious Fun website. If anyone knows of other options, or has experience they want to share about using any of the above, I'd be very interested in seeing it. HTH --Dethe -- Dethe Elza (delza@burningtiger.com) Chief Mad Scientist Burning Tiger Technologies (http://burningtiger.com) Living Code Weblog (http://livingcode.ca) From rkr_ii@yahoo.com Tue Dec 18 20:57:04 2001 From: rkr_ii@yahoo.com (Robert Rickenbrode) Date: Tue, 18 Dec 2001 12:57:04 -0800 (PST) Subject: [Edu-sig] Python sound. In-Reply-To: <3C1F8AC3.6050400@burningtiger.com> Message-ID: <20011218205704.41499.qmail@web13408.mail.yahoo.com> Hey folks, after some late night oil, I wrote these wrappers to Snack, to simplify the interface (my students haven't yet reached GUI or event driven programming). I hope this helps someone. (You will need Snack for Python here: http://www.speech.kth.se/snack/) Basically, there are 3 functions: SoundStart, SoundStop, and Beep. SoundStart wraps the initialization for Snack and Tkinter, and hides the tk window. SoundStop tries to clean-up after the initialization. Beep is exactly analogous to the winsound.Beep call, except that the duration is seconds rather than milliseconds. Example: import compsci compsci.SoundStart(50) #volume gain set to 50% compsci.Beep(261.63, 10) #plays Middle-C for 10 seconds compsci.SoundStop() #clean up Enjoy. __________________________ import Tkinter import tkSnack def SoundStart(volume=50): """Initialize the Sound System""" global root, filt root = Tkinter.Tk() tkSnack.initializeSnack(root) if volume > 100: volume = 100 elif volume < 0: volume = 0 tkSnack.audio.play_gain(volume) root.withdraw() def Beep(freq, duration): """Play a note of freq hertz for duration seconds""" s = tkSnack.Sound() filt = tkSnack.Filter('generator', freq, 30000, 0.0, 'sine', int(11500*duration)) s.stop() s.play(filter=filt, blocking=1) def SoundStop(): """Turn off the Sound System""" try: root = root.destroy() filt = None except: pass __________________________________________________ Do You Yahoo!? Check out Yahoo! Shopping and Yahoo! Auctions for all of your unique holiday gifts! Buy at http://shopping.yahoo.com or bid at http://auctions.yahoo.com From Jason Cunliffe" Message-ID: <000001c1882e$93a323e0$6501a8c0@vaio> ...Don't forget MIDI For recognizable tunes like Xmas songs, and fun programming with audible feeback MIDI makes a lot of sense. Most computers now have built in MIDI cards so no need for cables. Plus there are huge archives of MIDI files for free download no the web. Plus zillions of players, editors, sequencers and processors in softeare of all denonominations. MIDI is a protocol which applies well to programming. Changes of key, tempo, instrument, channel etc are significant and much easier than using FFTbased audio toolkits. Files are small and manageable. Cut and paste of elements also. To be honest I have not looked recently or very closely at Python for MIDI. I do know of these: http://www2.hku.nl/~simon2/python/ http://www.hyperreal.org/~est/python/MIDI/ http://www.quitte.de/midithing.html http://www.sabren.net/rants/2000/01/20000129a.php3 http://groups.google.com/groups?hl=en&selm=3C0F67FE.96E7CAE8%40alum.mit.edu See the MIDI python tools at The Vaults of Parnassus under 'Sound/Audio' http://www.vex.net/parnassus/apyllo.py/63131194 PyGame may well include MIDI handling. That would make interfacing with other devices a pleasure. The reason why I have not look at Python MIDI much is having to much fnu with two superb non-python music programming toolkits: KeyKit http://www.nosuch.com/keykit/ PD [PureData] http://www.pure-data.org/ http://www.danks.org/mark/GEM/ Whatever solution you use, if it invovves MIDI and you are using windows there are 2 essential free tools I recommend you install: MidiOx and MidiYoke http://www.midiox.com/ Together they provide a fabulous virtual patchbay allowing one to route MIDI siganl between several softawre on the fly, and also a monitor to watch the MIDI data stream in color + lots of cool system exclusive features. Both writen by MIDI software wizzards at Yamaha. For midi hardware, the best value I know of is also Yamaha. They make an external sythesizer and effects processor which connects via serial port to quickly provide amazing sound tools for around $50. Play very well with notebook computers as most po4rtable orchestra in your pocket with some remarakbel sounds based Yamaha's XG series. It includes MIDI connectors and also stereo efefct processing inputs for any soudn source. These are programmable via MIDI. http://www.yamahasynth.com/classic/mu10/q_mu10.htm http://www.yamaha.co.uk/xg/html/software/s_guide.htm A sub culture has grown up around the family of these with libraries, tool, interfaces and lore for gettind great results. One obvious value for teaching is that one can explore more than jst notes, but also ideas of depth, spacial efects yet remain within a programming context. http://xgmidi.wtal.de/software.html#XG%20-%20Editors good luck ./Jason From Jason Cunliffe" <000001c1882e$93a323e0$6501a8c0@vaio> Message-ID: <004901c188b0$b1651d20$6501a8c0@vaio> Season's greetings everyone! I saw a couple of pretty interesting looking new Python books in Barnes & Noble yesterday: Python Programming Patterns by Thomas W. Christopher Web Programming in Python: Techniques for Integrating Linux, Apache and MySQL by George K. Thiruvathukal, Thomas W. Christopher, John P. Shafaee ... meanwhile: http://www.goose-works.org/ Topic Maps Processing Model with Python API http://spectralpython.sourceforge.net/ Spectral Python (SPy): An Open Source Hyperspectral Image Processing Environment ... last but not least: http://mayavi.sourceforge.net/ The MayaVi Data Visualizer MayaVi is a free, easy to use scientific data visualizer. It is written in Python and uses the amazing Visualization Toolkit (VTK) for the graphics. It provides a GUI written using Tkinter. MayaVi is free and distributed under the GNU GPL. It is also cross platform and should run on any platform where both Python and VTK are available (which is almost any *nix, Mac OSX or Windows). yeow:-) regards ./Jason From dethe@burningtiger.com Wed Dec 19 17:56:03 2001 From: dethe@burningtiger.com (Dethe Elza) Date: Wed, 19 Dec 2001 09:56:03 -0800 Subject: [Edu-sig] New Books + goodies References: <20011217221902.96369.qmail@web13406.mail.yahoo.com> <000001c1882e$93a323e0$6501a8c0@vaio> <004901c188b0$b1651d20$6501a8c0@vaio> Message-ID: <3C20D4B3.7070303@burningtiger.com> Happy holograms! Not directly python related, but perhaps of interest to this group, O'Reilly has a new book out, "Physics for Game Developers," which could be very interesting in combination with, say, VPython or pyGame. The "Python and XML" book is supposed to be out this month, too. And while I was on the site looking up the above my eye was grabbed by "Ruby in a Nutshell" and "Programming Jabber," although the last one isn't due out until January. Ah, so much to read, so little time. I hope you all have a happy holiday season and a great new year. --Dethe -- Dethe Elza (delza@burningtiger.com) Chief Mad Scientist Burning Tiger Technologies (http://burningtiger.com) Living Code Weblog (http://livingcode.ca) From Burley, Brent" I just came across this O'Reilly article about Pygame, the Python Game library, http://www.onlamp.com/pub/a/python/2001/12/20/pygame.html. It gives an overview and a short example of moving a sprite around the screen with the arrow keys. The article also mentions "Severance, Blade of Darkness", a recently released commercial game from Codemasters, which includes an embedded python interpreter, http://www.codemasters.com/severance/front.htm. In fact, a python console can be launched from the game by giving a "-console" command line argument. It's been speculated on the net that as much as 90% of the game has been coded in python and it's also been reported that much of the source is included with the game as '.py' files (nearly half a million lines on one report). A personal testimonial: My nephew is a high school senior and has been programming with pygame for a few months. He's been learning python on his own (with much success I might add) on my suggestion as his C++ courses at school have been moving too slow for him to be able to do anything "interesting". He was just telling me that after a year and a half they are finally getting to "classes" in C++ and he was surprised at how much ahead of the game he was having been exposed to python classes with pygame. It's also worth noting that pygame is useful for projects other than games. There's a handful of apps on the pygame site, http://www.pygame.org including the San Diego Zoo Panda Cam and even a full-featured UI toolkit. Brent