From Burley, Brent" I haven't tried this, but it looks really nice: http://gerard.vermeulen.free.fr I do use Qt and PyQt quite a bit and recommend both highly. Brent From Louis.Bertrand@durhamc.on.ca Sat Jun 1 00:15:39 2002 From: Louis.Bertrand@durhamc.on.ca (Louis Bertrand) Date: Fri, 31 May 2002 19:15:39 -0400 Subject: [Edu-sig] Sandboxing python programs Message-ID: A while back I asked if there was any way of sandboxing a Python application beyond a chroot jail to run submitted programs in a batch and pre-grade them. Here's something that looks promising: http://www.citi.umich.edu/u/provos/systrace/ Ciao --Louis From csmith@blakeschool.org Sat Jun 1 23:36:29 2002 From: csmith@blakeschool.org (Christopher Smith) Date: Sat, 01 Jun 2002 17:36:29 -0500 Subject: [Edu-sig] Re: Emulating Pascal input Message-ID: > >Having read through the many threads on this topic on comp.lang.python I >realise and understand that modern programs' input generally requires >thought and customization from the program author. However, we strongly >feel there should be an equivalent to Pascal's readln (which is >basically C's scanf but without the formatting strings) for simple, >generally numerical, whitespace-separated input. > I know the course is ended now, but did you come up with a satisfactory solution? Here is an alternative which focuses on the numbers rather than the separators: you split out the numbers and then evaluate them as floats or ints. A "~" preceeds each of the physical lines in the script below so if the file gets mangled you can reconstruct it by removing spurious newlines until each line once again starts with a "~". #### ~ def ninput(n = None, fin = None, prompt = ''): ~ "Return n (or all) numbers from a line read from the keyboard (or file object)." ~ ~ import re ~ #iflo matches exponentials, floats, integers (in that order) ~ iflo=re.compile(r'([0-9]*\.?[0-9]+[eE][-+]?[0-9]+|[0-9]+\.?[0-9]*[eE][-+]?[0-9]+|[0-9]*\.[0-9]+|[0-9]+\.[0-9]*|[1-9][0-9]*)') ~ ~ if fin == None: # get the string ~ s = raw_input(prompt) ~ else: ~ s = fin.readline() ~ s=re.split(iflo,s) #split it apart, retaining the matched numbers ~ s=filter(lambda x:iflo.match(x),s) #keep only the numbers ~ for i in range(len(s)): #convert them to numerics ~ try: ~ s[i]=int(s[i]) ~ except: ~ s[i]=float(s[i]) ~ if n==None: ~ return s #send them all back as a list ~ else: ~ return s[:n]+[None]*(n-len(s)) #send back the number requested; send None for missing values #### Here are some examples from the interpreter: >>> ninput() # it doesn't matter what is on the line--the numbers are split out. This is the 1st number and here are 2 more: 3.4, 5.6 [1, 2, 3.3999999999999999, 5.5999999999999996] >>> ninput(2) 1,6.02e23 [1, 6.02e+23] >>> ninput(3) #if there aren't enough, None's are returned 1 [1, None, None] >>> x,y,z = ninput(3) (1,2) and (3,4) were the coordinates >>> print x,y,z 1 2 3 >>> /c From michael.williams@st-annes.oxford.ac.uk Mon Jun 3 11:44:44 2002 From: michael.williams@st-annes.oxford.ac.uk (Michael Williams) Date: Mon, 3 Jun 2002 11:44:44 +0100 Subject: [Edu-sig] Oxford Physics Python course Message-ID: <20020603104444.GA27777@st-annes.oxford.ac.uk> As promised I have edited the Oxford course into a state such that it is semi-comprehensible and, hopefully, useful to people on this list. It's available in HTML format (as generated by Fred Drake's scripts) at and in PS at . Perhaps I'm being harsh but I don't really think it's ready for use as a general purpose tutorial (quite apart from all the site-specific information). The course is designed to teach widely applicable programming skills (not Python) that students of physical sciences use every day (hence the lack of GUIs, OOP, etc.). It is used by first year Physics undergrads so we are able to assume considerable mathematical literacy, but no computing skills. This course (or something at this level) will almost certainly replace the current Pascal course next October, so it will be undergoing significant chages before then; in particular, all the exercises are taken directly from the old Pascal handbook and are perhaps not applicable to Python. One of the theses of this project (which I am conduncting for roughly one-third of my Masters dissertation) is that Python is easier to learn so we hope to introduce some more challenging exercises. Over the next few weeks (England's progress in the World Cup allowing!) I will be preparing the first draft of the dissertation discussing the successes and failures of the trial we have been running (we have used a group of 2nd year students as guinea pigs) and the relative merits of Python as a teaching language. I'd love to hear any comments on the style or content of the course. -- Michael From schuerer@pasteur.fr, letondal@pasteur.fr Thu Jun 6 15:25:25 2002 From: schuerer@pasteur.fr, letondal@pasteur.fr (Katja Schuerer) Date: Thu, 6 Jun 2002 16:25:25 +0200 Subject: [Edu-sig] online Python course for Bioinformatics Message-ID: <20020606142525.GC4576@caroline.sis.pasteur.fr> Hi, We have just finished to taught a Python course for Bioinformatics and we have thought that the online support () could be useful to others. This course is designed for Biologists who already have some programming knowledge, in other languages such as perl or C. For this reason, while presenting a substantial introduction to the Python language, it does not constitute an introduction to programming itself. What distinguishes this course from general Python introductory courses, is however the important focus on biological examples that are used throughout the course, as well as the suggested exercises drawn from the field of Biology. The second half of the course describes the Biopython (http://www.biopython.org/) set of modules. This course can be considered a complement to the Biopython tutorial, and what's more often refers to it, by bringing practical exercises using these components. -- Katja Schuerer Catherine Letondal From letondal@pasteur.fr Fri Jun 7 14:35:00 2002 From: letondal@pasteur.fr (Catherine Letondal) Date: Fri, 07 Jun 2002 15:35:00 +0200 Subject: [Edu-sig] Python @ Education: What are your problems? In-Reply-To: Your message of "Thu, 30 May 2002 00:47:25 +0200." <3CF55A7D.C81ED516@gmx.de> Message-ID: <200206071335.g57DZ0ws176676@electre.pasteur.fr> Ingo Linkweiler wrote: > What do you like when teaching python? My answers are related to the course that my colleague Katja announced yesterday - http://www.pasteur.fr/recherche/unites/sis/formation/python/. The course is intended for bioinformaticians, most of them having learnt either perl, C or Scheme. The last time we taugth this course, it was a 5 half-days course (we did not have the time to do the whole course contained on the support, which would need at least 1 full-time week). ------------------------------------------ > - Lists, Tupels, Dictionaries included ------------------------------------------ This is very important in bioinformatics. You have to manipulate strings, lists and dictionaries all the time. Biomolecules are indeed represented as string of characters: 'atgaagattttgatacttggtatttttctgtttttatgtagtacccc' but you spend your time converting them into lists or and back into string, etc, ... Also, the possibility to define the [] operator with __getitem__ is fantastic. In Biopython (www.biopython.org), they have defined dictionaries for all big genomic databases, so that by issuing a: GenBank['HUMCERP'] you fetch a db record from the Web server of the NCBI... Just one detail which makes things a little difficult. As I said, one very often has to change strings into lists and back to string in bioinformatics. To our knowledge, the only way to do this is with a type converter: l = list(s) then to get the list back (why is it that join is in strings and not in lists?): string.join(l) I don't know how to make this easier, but the difficulty seems to be in the fact that there are both object methods (join) and operators (len(), list(), str(),...). A solution could be to have some syntactic sugar to call the operator when the function is called as a method, e.g: l = s.list() would call list(s), or at least, the split method should accept "" separator: l = s.split("") which outputs: Traceback (most recent call last): File "", line 1, in ? ValueError: empty separator ------------------------------------------ > - interpreter: Everything can be tested ------------------------------------------ This is very important! Some problems in the interpreter: - copy&paste of several lines sometimes does not work - the interpreter should accept a command not exactly beginning at the exact position: >>> command when it's a single command. When you enter (by cut&paste) >>>command or: >>> command it does not work. I know it is related to the indentation problem, but for a beginner who already has difficulties, this is a cause of additional problems (ideally, a workspace as in Smalltalk would be marvellous - I haven't seen such thing in IDLE?). Other suggestions: - the interpreter could keep an history of the commands *between* sessions. Every one does this: entering python, trying a module, exiting, re-entering python, re-trying... - the history could be at first indentation level. I.e, if you enter the definition of a whole function in the interpreter, doing a "previous command" with the arrow key should return the whole definition, as an editable buffer. [To give an example, I have built an [not exactly End-] User programming tool with and editor that you can use to redefine, save, print, debug, run, etc... a method, without saving it in a file - it's to program in XOtcl (www.xotcl.org) - see: http://www.pasteur.fr/~letondal/biok/Images/method-editor.gif] ------------------------------------------------------------------------------------ > AND MORE IMPORTANT: > What are your problems with python? Are pupils/students having any > problems or often asked questions? One big problem is the confusion between module names and inner component names. For instance, when you define a module in a file, say, Dna.py, which defines a class Dna, you have to do a: from Dna import Dna if you want to create Dna objects with: dna = Dna() or you have to say: dna = Dna.Dna() I know this is completely coherent, and we spent as much time as needed until they understood the mechanism, but this was really a major difficulty. > What do you dislike at python? I like very much Python for clean and simple object-oriented programming. What I dislike: - self being mandatory in parameters list - no super() method call to call to super-class (AFAIK) - incremental and dynamic definition of class methods (I know you can do this by modifying the dictionary) (items which are probably already in a FAQ) -- Catherine Letondal -- Pasteur Institute Computing Center http://www.pasteur.fr/~letondal From dyoo@hkn.eecs.berkeley.edu Fri Jun 7 19:55:45 2002 From: dyoo@hkn.eecs.berkeley.edu (Danny Yoo) Date: Fri, 7 Jun 2002 11:55:45 -0700 (PDT) Subject: [Edu-sig] Python @ Education: What are your problems? In-Reply-To: <200206071335.g57DZ0ws176676@electre.pasteur.fr> Message-ID: > - no super() method call to call to super-class (AFAIK) In Python versions previous to 2.2, this could be done with the __bases__ attribute: ### >>> class Parent: ... def sayHello(self): ... print "hello" ... >>> class Child(Parent): ... def sayHello(self): ... print "My mom says:", self.__class__.__bases__[0].sayHello(self) ... >>> p, c = Parent(), Child() >>> p.sayHello() hello >>> c.sayHello() My mom says: hello ### but as you can tell, this is really awkward! Multiple inheritance, combined with the dynamic features of Python (__getattr__/__setattr__), can complicate things. Python 2.2 has a new "super()" function that simplifies this a lot. With super(), the example above looks like: ### class Parent(object): def sayHello(self): print "Hello!" class Child(Parent): def sayHello(self): print "My mom says", super(Child, self).sayHello() ### See: http://www.python.org/doc/current/whatsnew/sect-rellinks.html for details on this new function. Hope this helps! From guido@python.org Fri Jun 7 20:04:39 2002 From: guido@python.org (Guido van Rossum) Date: Fri, 07 Jun 2002 15:04:39 -0400 Subject: [Edu-sig] Python @ Education: What are your problems? In-Reply-To: Your message of "Fri, 07 Jun 2002 11:55:45 PDT." References: Message-ID: <200206071904.g57J4dD27183@pcp02138704pcs.reston01.va.comcast.net> > ### > >>> class Parent: > ... def sayHello(self): > ... print "hello" > ... > >>> class Child(Parent): > ... def sayHello(self): > ... print "My mom says:", > self.__class__.__bases__[0].sayHello(self) > ... > >>> p, c = Parent(), Child() > >>> p.sayHello() > hello > >>> c.sayHello() > My mom says: hello > ### > > but as you can tell, this is really awkward! It is also wrong. Consider >>> class GrandChild(Child): pass ... >>> g = GrandChild() >>> g.sayHello() (infinite loop) --Guido van Rossum (home page: http://www.python.org/~guido/) From dyoo@hkn.eecs.berkeley.edu Fri Jun 7 20:21:14 2002 From: dyoo@hkn.eecs.berkeley.edu (Danny Yoo) Date: Fri, 7 Jun 2002 12:21:14 -0700 (PDT) Subject: [Edu-sig] Python @ Education: What are your problems? In-Reply-To: <200206071904.g57J4dD27183@pcp02138704pcs.reston01.va.comcast.net> Message-ID: On Fri, 7 Jun 2002, Guido van Rossum wrote: > > ### > > >>> class Parent: > > ... def sayHello(self): > > ... print "hello" > > ... > > >>> class Child(Parent): > > ... def sayHello(self): > > ... print "My mom says:", > > self.__class__.__bases__[0].sayHello(self) > > ... > > >>> p, c = Parent(), Child() > > >>> p.sayHello() > > hello > > >>> c.sayHello() > > My mom says: hello > > ### > > > > but as you can tell, this is really awkward! > > It is also wrong. Consider > > >>> class GrandChild(Child): pass > ... > >>> g = GrandChild() > >>> g.sayHello() > (infinite loop) Doh. Let me try that one more time. ### class Parent: def sayHello(self): print "Hello" class Child(Parent): def sayHello(self): print "My mom says:", Parent.sayHello(self) ### Thanks for the correction! From jeff@elkner.net Tue Jun 11 01:18:20 2002 From: jeff@elkner.net (Jeffrey Elkner) Date: 10 Jun 2002 20:18:20 -0400 Subject: [Edu-sig] Karel the Robot Comes to Yorktown... Message-ID: <1023754701.1853.129.camel@robeson> Hi All, Every year something terrific comes out of Yorktown High School's participation in the Python Conference. This year was even better than the previous two, since it was near enough to us that thirteen of our students could attend. We learned a lot and met many interesting people, and the students left the conference turned on to programming. The highlight of this year's conference for us has to be Michele Moore's tutorial, "Graphical Interface Programming in Python". Ironically, it wasn't until months after the conference that I realized just how important it was. Ten of my thirteen students took it upon themselves to attend the tutorial, which opened my eyes as to just how much they wanted to learn to do GUI programming (up to that point not a part of the 1st year program). The tutorial was way over their heads, but moved by my students evident interest in the subject I talked to Michele after her presentation and asked her if she would be interested in helping some of my students learn Python GUI programming. And did she ever help! First, she came to one of our Linux Users Group meetings and gave a presentation right at the student's level of understanding. Then she mentored several of our students to the point that they are becoming quite adept. The most telling result of these efforts is the release of a Python implementation of Karel the Robot, with a graphical interface written in wxPython by Yorktown student programmers Donald Oellerich and Wassem Daher. This project would not have been finished on time (and I should add, under budget ;-) if it were not for Michele's generous help. The Project now has a sourceforge site at: http://pykarel.sourceforge.net The Python community continues to amaze me with it's generosity and eagerness to help, and provides a reason every bit as important as the many merits of the language itself for using Python to introduce students to programming. jeff elkner yorktown high school arlington, va From jmillr@umich.edu Tue Jun 11 20:39:40 2002 From: jmillr@umich.edu (John Miller) Date: Tue, 11 Jun 2002 15:39:40 -0400 Subject: [Edu-sig] Re: Edu-sig digest, Vol 1 #526 - 1 msg In-Reply-To: <20020611160003.25425.52292.Mailman@mail.python.org> Message-ID: First, let me say that I haven't actually downloaded and tried pyKarel yet, my comment is based strictly on the screenshots at the website. From those screenshots, it appears that users of the system are inputting *Karel* commands to make the robot perform certain activities. However, I would much rather see users inputting *Python* commands to make the robot perform those activities. Karel is designed to introduce programming concepts to beginning users, yet I would much rather those users be learning Python instead of Karel, which would have to be unlearned if and when they got to Python proper. Perhaps pyKarel could be repurposed to 'pyBot' or something similar that taught the same programming concepts using the Python language? Nevertheless, admirable job by the students! John Miller On Tuesday, June 11, 2002, at 12:00 PM, jeff@elkner.net wrote: > Hi All, > [snip] > The most telling result of these efforts is the release of a Python > implementation of Karel the Robot, with a graphical interface written in > wxPython by Yorktown student programmers Donald Oellerich and Wassem > Daher. This project would not have been finished on time (and I should > add, under budget ;-) if it were not for Michele's generous help. > > The Project now has a sourceforge site at: > > http://pykarel.sourceforge.net From urnerk@qwest.net Wed Jun 12 02:15:33 2002 From: urnerk@qwest.net (Kirby Urner) Date: Tue, 11 Jun 2002 21:15:33 -0400 Subject: [Edu-sig] Chinese Python In-Reply-To: <1023754701.1853.129.camel@robeson> References: <1023754701.1853.129.camel@robeson> Message-ID: <20020611211533.2ec18808.urnerk@qwest.net> I've long wondered whether unicode would give rise to more programming languages moving away from the Roman alphabet. With Python, this appears to be happening. Kirby ============== http://sourceforge.net/forum/forum.php?forum_id=185103 ChinesePython is a translation of Python scripting language itself into chinese. Not only the variable names, user messages/warnings/prompts but most notably, the reserved keywords and builtin types. 3.14 changes: * more translated messages * standardize names * modified string/unicode string hash method * modified function names * fix bugs From gherman@darwin.in-berlin.de Wed Jun 12 09:11:03 2002 From: gherman@darwin.in-berlin.de (Dinu Gherman) Date: Wed, 12 Jun 2002 10:11:03 +0200 (CEST) Subject: [Edu-sig] Chinese Python In-Reply-To: <20020611211533.2ec18808.urnerk@qwest.net> References: <1023754701.1853.129.camel@robeson> <20020611211533.2ec18808.urnerk@qwest.net> Message-ID: <1023869462.3d07021701507@webmail.in-berlin.de> Kirby Urner : > I've long wondered whether unicode would give rise to more > programming languages moving away from the Roman alphabet. > With Python, this appears to be happening. Sounds like we'd soon need a Transliteration-Nanny for having at least an idea about the Chinese ("red snake"?) standard library to come... or even import it! ;-) Dinu From fotisg@science.uva.nl Fri Jun 21 10:42:00 2002 From: fotisg@science.uva.nl (fotisg@science.uva.nl) Date: Fri, 21 Jun 2002 11:42:00 +0200 (MEST) Subject: [Edu-sig] Who knows? Maybe someone here is interested in this... Message-ID: <3797.146.50.18.115.1024652520.squirrel@webmail.science.uva.nl> -------- Original Message -------- Subject: presentation of the work of Fotis Georgatos; the AMSTEL institute From: gef@ceid.upatras.gr Date: Tue, June 18, 2002 1:23 pm To: ams@science.uva.nl Dear colleagues, You are cordially invited to the defence of the Masters thesis entitled: "How applicable is Python as first computer language for teaching programming in a pre-university educational environment, from a teacher's point of view?" Next Tuesday, June 25, from 14.00 till 15.30 Fotis Georgatos will present his work at the Studio Classroom, AMSTEL Institute. Fotis Georgatos is following the International Masters program "Mathematics and Science Education" organized by the AMSTEL Institute. In his case the Masters thesis is aimed at teaching a computer language, in particular Python, and what are the teachers' opinion over that. The presentation includes a discussion on * research subject setting * background work * chosen methodology * results and * conclusions Hopefully the critique over the findings of this research will be followed by a discussion on what the future concerns in teaching programming could be like. Please, do forward this announcement within your departments to possibly interested colleagues that should be aware of it. You may find the Research Report on the project's website: http://amstel.science.uva.nl/~fotisg/python/ Kind regards, Fotis Georgatos Dr. Ton Ellermeijer AMSTEL institute, Faculty of Science Universiteit van Amsterdam Kruislaan 404 NL - 1098 SM Amsterdam The Netherlands tel ++ 31 20 5257963 fax ++ 31 20 5255866 From guido@python.org Fri Jun 21 14:05:21 2002 From: guido@python.org (Guido van Rossum) Date: Fri, 21 Jun 2002 09:05:21 -0400 Subject: [Edu-sig] Who knows? Maybe someone here is interested in this... In-Reply-To: Your message of "Fri, 21 Jun 2002 11:42:00 +0200." <3797.146.50.18.115.1024652520.squirrel@webmail.science.uva.nl> References: <3797.146.50.18.115.1024652520.squirrel@webmail.science.uva.nl> Message-ID: <200206211305.g5LD5MA24817@pcp02138704pcs.reston01.va.comcast.net> Darn! So close. I will be in the Netherlands that day -- but on my way to EuroPython, so I still can't make it. :-( I'd like to hear the outcome. Will you put any artifacts on the web? Please point us to them here! --Guido van Rossum (home page: http://www.python.org/~guido/) From be_well@linuxmail.org Fri Jun 21 17:07:00 2002 From: be_well@linuxmail.org (Will Well) Date: Sat, 22 Jun 2002 00:07:00 +0800 Subject: [Edu-sig] Glad Message-ID: <20020621160700.25268.qmail@linuxmail.org> mid-summer på er! Larry -- Get your free email from www.linuxmail.org Powered by Outblaze From h.baumgartl@chello.nl Sat Jun 22 11:05:03 2002 From: h.baumgartl@chello.nl (Henry Baumgartl) Date: Sat, 22 Jun 2002 12:05:03 +0200 Subject: [Edu-sig] Re: Who knows? Maybe someone here is interested in this... (Guido van Rossum) References: <20020621160004.16157.78037.Mailman@mail.python.org> Message-ID: <002401c219d4$46ef6350$837e3850@dkn02> If it helps, you could ride with me by car to Charleroi after the presentation in Amsterdam. Regards, Henry Baumgartl > Message: 2 > To: fotisg@science.uva.nl > cc: edu-sig@python.org > Subject: Re: [Edu-sig] Who knows? Maybe someone here is interested in this... > From: Guido van Rossum > Date: Fri, 21 Jun 2002 09:05:21 -0400 > > Darn! So close. I will be in the Netherlands that day -- but on my > way to EuroPython, so I still can't make it. :-( > > I'd like to hear the outcome. Will you put any artifacts on the web? > Please point us to them here! > > --Guido van Rossum (home page: http://www.python.org/~guido/) > > > > > --__--__-- > > _______________________________________________ > Edu-sig mailing list > Edu-sig@python.org > http://mail.python.org/mailman/listinfo/edu-sig > > > End of Edu-sig Digest