From kirill_simonov@mail.ru Thu Feb 6 22:59:25 2003 From: kirill_simonov@mail.ru (Kirill Simonov) Date: Fri, 7 Feb 2003 00:59:25 +0200 Subject: [Edu-sig] Defining source code encoding for Python 2.3 Message-ID: <20030206225925.GB747@abulafia.local> Hello, While I rather like this new feature, I think that the current implementation is too rigour. Imagine a student that writes her first script: name = raw_input("What's your name? ") # a russian phrase here print "Hi %s!" % name With Python 2.3a1, she'll get DeprecationWarning. With a future version of Python, this code would cause SyntaxError. Does anyone really think that she must define a source code encoding here? That claim would break any possibility to use Python in schools. We have a lot of troubles with broken i18n support in IDLE and Tkinter, but this would be a total nightmare. Also defining encoding is useless here, since it affects only Unicode literals. Best regards, Kirill Simonov From exarkun@intarweb.us Thu Feb 6 23:15:18 2003 From: exarkun@intarweb.us (Jp Calderone) Date: Thu, 6 Feb 2003 18:15:18 -0500 Subject: [Edu-sig] Re: Defining source code encoding for Python 2.3 In-Reply-To: <20030206225925.GB747@abulafia.local> References: <20030206225925.GB747@abulafia.local> Message-ID: <20030206231518.GA32422@meson.dyndns.org> --xHFwDpU9dbj6ez1V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 07, 2003 at 12:59:25AM +0200, Kirill Simonov wrote: > Hello, >=20 > While I rather like this new feature, I think that the current > implementation is too rigour. Imagine a student that writes her > first script: >=20 > name =3D raw_input("What's your name? ") # a russian phrase here > print "Hi %s!" % name >=20 > With Python 2.3a1, she'll get DeprecationWarning. With a future > version of Python, this code would cause SyntaxError. >=20 > Does anyone really think that she must define a source code encoding > here? That claim would break any possibility to use Python in schools. > We have a lot of troubles with broken i18n support in IDLE and Tkinter, > but this would be a total nightmare. >=20 > Also defining encoding is useless here, since it affects only Unicode > literals. >=20 A gargantuan thread on this topic seems to have *just* petered out.=20 http://groups.google.com/ will give you the whole thing, if it is already gone (unlikely!) from your local news feed. Jp --=20 #!/bin/bash ( LIST=3D(~/.netscape/sigs/*.sig) cat ${LIST[$(($RANDOM % ${#LIST[*]}))]} echo --$'\n' `uptime` ) > ~/.netscape/.signature --=20 up 53 days, 3:50, 4 users, load average: 0.41, 0.40, 0.33 --xHFwDpU9dbj6ez1V Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (GNU/Linux) iD8DBQE+QuyGedcO2BJA+4YRAgI2AKC9bgnkvaDGadeEUHzQEynZ/409pwCfbihQ G8zgrGpcgIFD4pDWOTas9jg= =A7VV -----END PGP SIGNATURE----- --xHFwDpU9dbj6ez1V-- From ghanson@postmaster.co.uk Sat Feb 8 22:01:40 2003 From: ghanson@postmaster.co.uk (george hanson) Date: Sat, 08 Feb 2003 22:01:40 +0000 Subject: [Edu-sig] Does any such tutorial exist? Message-ID: Hello, I wanted to write a tutorial using only a few basic constructs of python (function definition and application, conditional expressions, structure definition, local definitions, and assignments) to teach basic design principles. Something like the scheme online book 'How to Design Programs' http://www.htdp.org This is just to gently introduce students to programming using python like syntax, before going into python specific features in depth. Does any similar project already exist? Cheers George From urnerk@qwest.net Sat Feb 8 22:10:59 2003 From: urnerk@qwest.net (Kirby Urner) Date: Sat, 08 Feb 2003 14:10:59 -0800 Subject: [Edu-sig] Does any such tutorial exist? In-Reply-To: Message-ID: <5.2.0.9.0.20030208140951.02529760@pop.ptld.qwest.net> At 10:01 PM 2/8/2003 +0000, george hanson wrote: >Hello, I wanted to write a tutorial using only a few basic constructs of >python (function definition and application, conditional expressions, >structure definition, local definitions, and assignments) to teach basic >design principles. >Something like the scheme online book 'How to Design Programs' >http://www.htdp.org >This is just to gently introduce students to programming using python like >syntax, before going into python specific >features in depth. >Does any similar project already exist? > >Cheers >George Would you include the class definition statement? I think classes are quite basic in Python (one of its strengths) and should not be segregated to an "advanced" section. Kirby From ghanson@postmaster.co.uk Sun Feb 9 00:45:39 2003 From: ghanson@postmaster.co.uk (george hanson) Date: Sun, 09 Feb 2003 00:45:39 +0000 Subject: [Edu-sig] Does any such tutorial exist? Message-ID: On Sun, 09 Feb 2003 00:39:42 +0000 "george hanson" wrote: > On Sat, 08 Feb 2003 15:23:02 -0800 > "Kirby Urner" wrote: > > At 11:07 PM 2/8/2003 +0000, george hanson wrote: > > > > > Of course the more Pythonic way to express this would be: > > > > >>> reduce(add, [sqr(i) for i in range(5)]) > > 30 > > > > but I gather you're trying to keep this kind of syntactic >sugar for latter. > > Definitely, because I have had enough of students asking: > 'why is this?','why is that','can you explain that again?' > Also, they sometimes used ineficient designs, so I wanted a > way to make them keep in mind only designing a solution to the problem.(but at the same time making sure there would be > a connection to python, else I would have used flowcharts) > > > Cheers > George From urnerk@qwest.net Sun Feb 9 04:37:20 2003 From: urnerk@qwest.net (Kirby Urner) Date: Sat, 08 Feb 2003 20:37:20 -0800 Subject: [Edu-sig] Does any such tutorial exist? In-Reply-To: Message-ID: <5.2.0.9.0.20030208203655.01119c58@pop.ptld.qwest.net> At 11:07 PM 2/8/2003 +0000, george hanson wrote: > > > >Thats true but hmm, it wasnt my original intention. >(It may be because I remember how we were taught long ago, >using structured programming flowcharts. But with most universities teaching >Java as a first language, things may have changed.) > >Now that you pointed it out, I might have to look into it and reconsider. > > >Cheers >George Yeah, I think the OOP thing should be introduced early, so that newcomers don't have to recapitulated the "paradigm shift" from procedural. It's kinda like how countries today go straight to cell phone, skipping the whole land line phase of infrastructure development. Along the same lines, I think a basic intro should give at least a few examples of passing functions as parameters. For example: >>> def sum(f,alist): # first argument is some function sum = 0 for x in alist: # 2nd argument feeds f sum += f(x) # accumulate f(x1) + f(x2) + f(x3)... return sum >>> def sqr(x): return x * x >>> sum(sqr,range(5)) 30 >>> 0 + 1 + 4 + 9 + 16 30 Of course the more Pythonic way to express this would be: >>> reduce(add, [sqr(i) for i in range(5)]) 30 but I gather you're trying to keep this kind of syntactic sugar for latter. Once students know the basics, then you can explain list comprehensions and such using equivalent "long hand" syntax, i.e. decode these more compressed forms in terms of what's already understood. My thought is if you get this kind of flexibility in early (e.g. functions might be parameters to other functions), it'll spark students to explore more. I think the OOP thing is important because even at the basic level, expressions like "aaa".upper() make sense only when you understand that "aaa" is an object. Likwise 1 .__add__(2) is legal Python -- although this I *would* consider more advanced syntax (but it builds on early OOP understanding). Kirby From Arthur" >Of course the more Pythonic way to express this would be: > >>> reduce(add, [sqr(i) for i in range(5)]) >30 Not in my book. The essence of the function passing code could, I thought, be understood - at least in outline - on a reading by a non-programmer. The reduce(add...) business with a list comprehension thrown in - is to me obscure, in precisely the way code often seems obscure to the non-coder. Its would be a pity if "more Pythonic" evolved to mean "the way someone versed in Python's obscurities might do it to save some keystokes". And precisely why some might feel that list comprehensions, for example, are themselves unPythonic - or at least unnecessary. On the other hand, I use list comprehensions myself - in cases where its the first solution that crosses my mind, and I want to move on. And I guess the fact that it is, at this point, not uncommonly the first solution that crosses the mind of someone like myself - a non-sophisticate - is some indication that it does somehow belong. reduce(add..) syntax, for whatever reason, never. Even in Numeric - where the reduce(add..) is core - it is generally wrapped into a function with a more generically identifiable mathematical meaning. But it's probably the combination that seems to me to put the one-liner over the edge into something too something or other. But of course reduce(add..) pre-dated list comprehensions. So my comment is not as to the evolution of the language. Although I would argue that more possibilities for obscurities have evolved over time. The importance of readibility of code is accepted, I think, as a Pythonic principle. Perhaps I define it too broadly by hoping it to mean readable, in some sense - and to the extent reasonable and realistic - as text to the eyes of the non-coder. But even if unrealistically broad, it is probably one way to think of achieving readability even when coding Python in a real world situation. A worthy but unattainable goal - that at least keeps one moving in the right direction. I do go on, don't I. Art From urnerk@qwest.net Sun Feb 9 19:14:58 2003 From: urnerk@qwest.net (Kirby Urner) Date: Sun, 09 Feb 2003 11:14:58 -0800 Subject: [Edu-sig] Does any such tutorial exist? In-Reply-To: <000901c2d04c$a3052330$ec5ff6d1@Arts> Message-ID: <5.2.0.9.0.20030209104625.0266fa68@pop.ptld.qwest.net> At 10:05 AM 2/9/2003 -0500, Arthur wrote: > >Of course the more Pythonic way to express this would be: > > > >>> reduce(add, [sqr(i) for i in range(5)]) > >30 > >Not in my book. > >The essence of the function passing code could, I thought, be understood - >at least in outline - on a reading by a non-programmer. > >The reduce(add...) business with a list comprehension thrown in - is to me >obscure, in precisely the way code often seems obscure to the non-coder. Yes. You and Tim Peters both wisely counsel against over-use/abuse of these particular sugars. Sometimes I find them compact and expressive, but it should be perfectly ok to write: def sum (f, x): sum = 0 for i in range(x): sum += f(i) return sum instead of: def sum (f, x): return reduce(add, [f(i) for i in range(x)] ) >Its would be a pity if "more Pythonic" evolved to mean "the way someone >versed in Python's obscurities might do it to save some keystokes". Some just find it more expressive. The "reduce" concept is found in other languages, e.g. Mathematica and J, albiet in variant forms. If you're coming from one of these backgrounds, then you're happy to find the grammar you're used to available in Python. And of course the list comprehension idea is very familiar to Haskell people. Japanese is obscure if you don't speak Japanese -- people don't all approach Python from the same background. Many come to it from another programming language. List comprehensions certainly cut down on the need to use lambda, which I regard as more unfamiliar to a beginner, although again a useful intro to languages which make lambda a core concept. >And precisely why some might feel that list comprehensions, for example, are >themselves unPythonic - or at least unnecessary. I agree that they're unnecessary in principle. But then so is range() -- you could just increment, the way it's done in C. >reduce(add..) syntax, for whatever reason, never. Even in Numeric - where >the reduce(add..) is core - it is generally wrapped into a function with a >more generically identifiable mathematical meaning. I think a beginning Python programmer should at least know about the operator module, and the ability to import add, sub, mul etc. to use in such situations. For example, if you're doing a lot with 3-tuples, as when adding 3d vectors, it's useful to be able to go: >>> a = (1,2,3) >>> b = (3,2,1) >>> def addtuple(x,y): return tuple(map(add,x,y)) >>> addtuple(a,b) (4, 4, 4) >But it's probably the combination that seems to me to put the one-liner over >the edge into something too something or other. > >But of course reduce(add..) pre-dated list comprehensions. So my comment is >not as to the evolution of the language. Although I would argue that more >possibilities for obscurities have evolved over time. The thing about reduce, map and apply is that they take functions as arguments. This is characteristic of functional programming. The thread was "intro to basic Python" and I was suggesting that both the OOP paradigm, and the functional paradigm, as well as the more classic procedural paradigm, all intersect in Python, and it's worthwhile to not just seize on the procedural alone. One should "get in on the ground floor" with OOP and functional concepts as well. Primitives which take functions as arguments, like map, reduce and apply, are good examples of functional concepts. I think there's a danger in having people most comfortable with procedural programming inadvertently depriving newbies from accessing alternative philosophies that are just as basic in their own way. >The importance of readibility of code is accepted, I think, as a Pythonic >principle. Perhaps I define it too broadly by hoping it to mean readable, >in some sense - and to the extent reasonable and realistic - as text to the >eyes of the non-coder. > >But even if unrealistically broad, it is probably one way to think of >achieving readability even when coding Python in a real world situation. >A worthy but unattainable goal - that at least keeps one moving in the right >direction. > >I do go on, don't I. > >Art I think an intro course that focuses on basics might do well to actually spend some time on these broad brush stroke concepts: procedural, functional and object oriented, using Python examples to illustrate what's meant. At least for me, it helps to have this higher level heuristics floating around -- gives me more of a frame of reference for the new material. I like historical context. Kirby From Arthur" >I like historical context. Like, for instance, Euclid, when looking at geometry? ;) I do go on ... relentlessly. Art From urnerk@qwest.net Sun Feb 9 21:15:08 2003 From: urnerk@qwest.net (Kirby Urner) Date: Sun, 09 Feb 2003 13:15:08 -0800 Subject: [Edu-sig] re: Does any such tutorial exist? In-Reply-To: <001d01c2d072$f3236ef0$db65f6d1@Arts> Message-ID: <5.2.0.9.0.20030209130826.024e5500@pop.ptld.qwest.net> At 02:39 PM 2/9/2003 -0500, Arthur wrote: > >I like historical context. > >Like, for instance, Euclid, when looking at geometry? ;) I have no problem with Euclid. But geometry didn't stop (nor start) with him. On other lists, I pound the table about the importance of Euclid's Algorithm (that's what it's called, but it likely predates him). There's a geometric interpretation, but it's mainly about finding the gcd of two numbers. Guido shows how compact Python can be by giving us: def gcd(a,b): while b: a,b = b,a%b return a Not all that's Euclid (or Euclid + Python) is geometry. >I do go on ... relentlessly. > >Art I think our experiential world is not flat, but spatial. So I advocate starting in space and moving to the plane in special case. Plane geometry is a subspecies of spatial geometry, not vice versa. Either way, we get to do constructions. Either way, it's heavily influenced by Greek thinking (and terminology). Kirby PS: in PyCrust, I can't seem to cut from my emails and paste to the prompt (e.g. the above function, which I first wrote here, then cut and pasted in IDLE to test). Is there a way? From pobrien@orbtech.com Sun Feb 9 22:34:52 2003 From: pobrien@orbtech.com (Patrick K. O'Brien) Date: 09 Feb 2003 16:34:52 -0600 Subject: [Edu-sig] re: Does any such tutorial exist? In-Reply-To: <5.2.0.9.0.20030209130826.024e5500@pop.ptld.qwest.net> References: <5.2.0.9.0.20030209130826.024e5500@pop.ptld.qwest.net> Message-ID: "Kirby Urner" writes: > PS: in PyCrust, I can't seem to cut from my emails and paste > to the prompt (e.g. the above function, which I first wrote > here, then cut and pasted in IDLE to test). Is there a way? Look at shell.help() for the keybindings, or use the Edit menu. What platform are you on and what version of PyCrust (shell.about())? I'm still trying to resolve some clipboard issues on Linux. Right now I can't paste to/from Emacs. :-( -- Patrick K. O'Brien Orbtech http://www.orbtech.com/web/pobrien ----------------------------------------------- "Your source for Python programming expertise." ----------------------------------------------- From Arthur" Kirby suggests- >I think a beginning Python programmer should at least know about the >operator module, and the ability to import add, sub, mul etc. to use in such >situations Or else they can wait a few years until someone suggests it on edu-sig. Looked at it more closely and found operator.IsNumberType() - which is something I needed and worked around in the past. And I knew the work-around was a potential problem. I am at the get to know your libraries stage of my Python education. Took a while to get there. The way I happened to have approached things. Thanks for the nudge. Art From jiescobar@net-uno.net Wed Feb 12 02:35:32 2003 From: jiescobar@net-uno.net (Javier Escobar) Date: Tue, 11 Feb 2003 22:35:32 -0400 Subject: [Edu-sig] Teaching Physics with Python Message-ID: Hi everyone! My name is Javier. I'm doing an undergraduate work about teaching physics with Python. It was a long time searching for a good topic for my work when I finally knew about Phyton and thought this programing language could help students learn physics. I´ve been reviewing various documents on the web about Python and it´s applications to education, physics and mathematics. I read CP4E of Guido van Rossum, also vised some sites of physics courses that use Python as a teaching tool, also visited Oregon Curriculum page about teaching math with Python. I study in the Central University of Venezuela, and the idea is to develop some kind of computer programming course for physics students at the university. The objective of the undergraduate work would be to demonstrate that a programming course with Python helps physics students learn. I would like to receive some comments, ideas, sugestions. At this point, I'm just figuring out the most general ideas about the work, and I haven´t started jet using Python. I would really appreciate your comments. From jiescobar@net-uno.net Wed Feb 12 02:35:33 2003 From: jiescobar@net-uno.net (Javier Escobar) Date: Tue, 11 Feb 2003 22:35:33 -0400 Subject: [Edu-sig] Oregon Curriculum Message-ID: This is a multi-part message in MIME format. ------=_NextPart_000_0000_01C2D21D.E3FA2020 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Hi Kirby: I would like that you could share with us how you came up with the Oregon Curriculum. I'm involved in teaching physics. Learning physics involves a lot of learning math, so I was quite interested in your aproach of math teaching. My wife is teaching mathematics at a woodwork institute. I'm considering in doing my undergraduate work at the Central University of Caracas in teaching physics with Python. With my wife, I'm planning to develop a workshop on learning math with computer programing. Are you still working on the Oregon Curriculum home page? Where the name "Oregon Curriculum" comes from? From Oregon, y supose :) I can't get acces to the page http://www.inetarena.com/~pdx4d/ocn/calculus0.html This link should give me acces to an article about precalculus. Other observation is that in the linear overview page, the link Vector Algebra takes you to http://www.inetarena.com/~pdx4d/ocn/numeracy1.html. Check this link, it seems to me that there could be a mistake since numeracy2.html, the article tittled "Getting Inventive with Vectors", better matches the topic of the link mentioned. Two more observations: ¿could you put your email address on the page? I wanted to write to you but I couldn't find your email address. I got it reading my edu-sig mails. I think your work is very interesting. It would be nice if you could add links to the Linear Overview page, this involves developing the Oregon Curriculum, I think. It seems you´re the only one who mantain this web site. If this is the case, I think is hard for you to write down the development of all the topics listed in the overview. Maybe you could get some help, don't you think? Best wishes. Sincerelly Javier Escobar ------=_NextPart_000_0000_01C2D21D.E3FA2020 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Hi Kirby:
I would like that you could share with us how you came = up with=20 the Oregon Curriculum.  I'm involved in teaching = physics.  =20 Learning physics involves a lot of learning math, so I was quite = interested in=20 your aproach of math teaching.  My wife is teaching mathematics at = a=20 woodwork institute.  I'm considering in doing my undergraduate work = at the=20 Central University of Caracas in teaching physics with Python.  = With my=20 wife, I'm planning to develop a workshop on learning math with computer=20 programing.  Are you still working on the Oregon Curriculum home=20 page?  Where the name "Oregon Curriculum" comes from?  From = Oregon, y=20 supose :)  I can't get acces to the page http://www.inetarena.com/~pdx4d/ocn/calculus0.html&nb= sp; This=20 link should give me acces to an article about precalculus.  Other=20 observation is that in the linear overview page, the link Vector=20 Algebra  takes you to http://www.in= etarena.com/~pdx4d/ocn/numeracy1.html. =20 Check this link, it seems to me that there could be a mistake since=20 numeracy2.html, the article tittled "Getting Inventive with Vectors", = better=20 matches the topic of the link mentioned.  Two more observations: = =BFcould you=20 put your email address on the page?  I wanted to write to you but I = couldn't find your email address.  I got it reading my edu-sig = mails. =20 I think your work is very interesting.  It would be nice if you = could add=20 links to the Linear Overview page, this involves developing the Oregon=20 Curriculum, I think.  It seems you=B4re the only one who mantain = this web=20 site.  If this is the case, I think is hard for you to write down = the=20 development of all the topics listed in the overview.  Maybe you = could get=20 some help, don't you think?  Best wishes.

Sincerelly

Javier Escobar

------=_NextPart_000_0000_01C2D21D.E3FA2020-- From hancock@anansispaceworks.com Wed Feb 12 09:30:28 2003 From: hancock@anansispaceworks.com (Terry Hancock) Date: Wed, 12 Feb 2003 01:30:28 -0800 Subject: [Edu-sig] Oregon Curriculum In-Reply-To: References: Message-ID: Hi Javier, On Tuesday 11 February 2003 06:35 pm, Javier Escobar wrote: > I would like to receive some comments, ideas, sugestions. > At this point, I'm just figuring out the most general ideas about the work, > and I haven´t started jet using Python. [...] > I'm involved in teaching physics. Well, you understand this is totally self-interested, but I would really like to see some of the following things (or find them if they already exist). I suspect that PyGame would come in handy for doing them, though there may be other options: 1) 2-D (or projected 3-D) n-body integrator for orbital mechanics demos. Especially a good interface for inputing objects, masses, and velocities of test objects. 2) A flat-space demonstrator of some kind -- basically like "Asteroids" but a little more straightforward, and possibly 3-D subjective. A docking simulator would fit really well. 3) Something that deals with the launch + staging problem -- with or without atmospheric drag considerations, but definitely considering ground collision. Probably a 2-D simulation is best. 4) Ballistic lander sim in 3-D (e.g. maybe building on FlightGear). 5) Use rocket nozzle parameters, fuel+oxy, and other physical parameters to compute thrust and specific impulse of an engine. That is, a rocket engine design simulation. These would all figure into a series of space technology classes we are planning to teach. Eventually, I'd probably plan to write them myself, but you did ask for suggestions. ;-) Obviously, a really cool program could put all these together in one simulator, but that sounds pretty complicated to me. I think a simple sim for each concept is probably better. Cheers, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com From Arthur" Lee wrote (last month) >Hi; >I wrote a python- and pygame-based turtle graphics system. >The project page is: >http://savannah.nongnu.org/projects/pygsear/ >Feedback welcome. Had a chance to look closer. Particularly fun - at least for this grownup - is the experimentation with using PyGame in conjunction with Twister. Looks like we get to an all Python multi-player online gaming environ. I am looking forward to trying to follow what's being done, and how its being down. High level, that is. Wondering, among other things, whether there is a way I can webize PyGeo - given the proper hosting environment - by going down this road. Was also a little surprised that Twister was Windows friendly. Art From Burley, Brent" Just stumbled onto this: http://www.zpr.uni-koeln.de/~gato Gato can display a graph (i.e. nodes and edges) and animate an algorithm that is operating on the graph. It works a bit like a debugger with a python code window that allows stepping, breakpoints, etc., but it also allows the speed to be regulated so you can just let it run and watch the animation. It uses only Tkinter so it's very portable and trivial to get running. Gato is interesting in its own right for teaching graph algorithms, but it's also useful in showing what's possible with python and Tk. Brent From python-edu@zesty.ca Sat Feb 15 07:54:54 2003 From: python-edu@zesty.ca (Ka-Ping Yee) Date: Sat, 15 Feb 2003 01:54:54 -0600 (CST) Subject: [Edu-sig] Interactive interpreter: expressions vs. statements In-Reply-To: <3E4D3AE8.F8FDA0E8@fa.disney.com> Message-ID: Hello all. I'm teaching a course in Python this semester at UC Berkeley. It's the first time i've designed and taught a course on my own, so it's an interesting challenge. You can check it out at http://zesty.ca/bc/. If you promise not to submit any forms, you can log in with the username and password "guest". Okay, on to the main topic. There are two related problems for Python beginners that i seem to be encountering over and over again: 1. Confusion about expressions vs. statements. The interpreter appears to yield the same response to "1 + 1" and to "print 2". But the "2" you see comes from different sources: for "1 + 1" it's the interpreter displaying the result, and for "print 2" it's the print statement sending the result to the terminal. 2. Confusion about return vs. print. If you define a function that returns 3 and a function that prints 3, they appear to evaluate to the same thing. The function that prints 3 actually returns None, but you can't see that because the interpreter chooses not to display the result when it is None. I talked to Michael Clancy recently, in the Berkeley CS department. He reports similar experiences in his 10+ years of teaching Scheme: once the students know a "print" command, lots of them will run into trouble with issue #1. This seems to happen consistently, year after year. I'd like to know whether any of you have encountered these problems before, how frequently they turn up, and how you have dealt with them. Thanks! (I have an idea in mind, but i'd like to hear about your experiences first.) -- ?!ng From ajsiegel@optonline.net Sat Feb 15 20:48:12 2003 From: ajsiegel@optonline.net (Arthur) Date: Sat, 15 Feb 2003 15:48:12 -0500 Subject: [Edu-sig] Alice update Message-ID: <000901c2d533$8ec21e50$2002a8c0@Arts> Stumbled upon the "new" Alice - out in 2.0b: http://www.alice.org Ironically, the "old" Alice claimed to be about "Interactive 3d Graphics for the Web" - not about programming education, and did have some Python content. The new Alice: '''' The focus of the Alice project is now to provide the best possible first exposure to programming for students ranging from middle schoolers to college students. """ But has *no* Python content that I can see. Other than using some Jython ministerially in the infrastructure. Which, to me, is neither surprising, nor a bad thing. But I do hope the Python in education materials, links and references are eventually updated to reflect the fact that Alice has no relevance to Python. I am sure it would be totally confusing for someone interested in Python and education to find themselves directed to www.alice.org. Even more so than previously. Art From urnerk@qwest.net Sat Feb 15 21:16:35 2003 From: urnerk@qwest.net (Kirby Urner) Date: Sat, 15 Feb 2003 13:16:35 -0800 Subject: [Edu-sig] Alice update In-Reply-To: <000901c2d533$8ec21e50$2002a8c0@Arts> Message-ID: <5.2.0.9.0.20030215130744.029bfbc8@pop.ptld.qwest.net> At 03:48 PM 2/15/2003 -0500, Arthur wrote: >Other than using some Jython ministerially in the infrastructure. "Ministerially" (?) -- is this radically different than "for scripting," which was how Python was used in earlier versions. What I read is: * Scripting in Alice is done with the Python scripting language so you may want to read the Pyhton Tutorial. [sic -- their typo not mine] and * With Jython, the Java version of Python, you can access all the Java classes from Python. This mean you can use anything from the Java API or the Alice2 API. http://www.alice.org/bvw02fall/scripting/scripting.html I agree with you insofar as this is not a "pure Python" environment. It's a different approach to learning programming, certainly. >Which, to me, is neither surprising, nor a bad thing. > >But I do hope the Python in education materials, links and references are >eventually updated to reflect the fact that Alice has no relevance to >Python. I think "no relevance" might be too strong, but I'll have to download the new Alice and give it a test drive, like I did for the older one, back when they hired me to work on that 'How To Program' thing (one of the Python books). Possibly the Alice link should be moved to a new Jython section of the Python edu-sig links page. Kirby From hancock@anansispaceworks.com Sat Feb 15 09:04:03 2003 From: hancock@anansispaceworks.com (Terry Hancock) Date: Sat, 15 Feb 2003 01:04:03 -0800 Subject: [Edu-sig] Interactive interpreter: expressions vs. statements In-Reply-To: References: Message-ID: On Friday 14 February 2003 11:54 pm, Ka-Ping Yee wrote: > 2. Confusion about return vs. print. > > I'd like to know whether any of you have encountered these > problems before, how frequently they turn up, and how you have > dealt with them. Seems to me the only thing to do is to show a few alternate cases, such as assigning a function result to a variable: >>> def pfunc(): ... print 'a' ... >>> def rfunc(): ... return 'a' ... >>> pfunc() a >>> a = pfunc() a >>> rfunc() 'a' >>> b = rfunc() >>> a >>> b 'a' >>> (There's also the point about the quoting here). Cheers, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com "Some things are too important to be taken seriously" From urnerk@qwest.net Sat Feb 15 21:54:08 2003 From: urnerk@qwest.net (Kirby Urner) Date: Sat, 15 Feb 2003 13:54:08 -0800 Subject: [Edu-sig] Interactive interpreter: expressions vs. statements In-Reply-To: References: <3E4D3AE8.F8FDA0E8@fa.disney.com> Message-ID: <5.2.0.9.0.20030215131750.029c2350@pop.ptld.qwest.net> > >I'd like to know whether any of you have encountered these >problems before, how frequently they turn up, and how you have >dealt with them. > >Thanks! > >(I have an idea in mind, but i'd like to hear about your >experiences first.) > > >-- ?!ng I think you ask very good questions. It's OK to use 'print' in place of 'return' if the audience for the output is an eyeball looking at stdout. You can actually produce fancy, formatted output this way, and maybe that's all you need. But Python is somewhat unaware of this window, just as actors on stage or in a movie are supposedly unaware of the audience (which they aren't, but that's the illusion). From Python's point of view, there's this pipe marked 'stdout' and it knows under what circumstances to stuff something into that pipe. Where it goes from there depends on the configuration -- usually it goes to some terminal window. But just because an actor says something out loud (as in a soliloquy), if no other actor overhears, then only the audience is privy. An actor much actually talk to another actor if that other actor is to "get it". That's when we use 'return' with assignment, as in >>> a = f(x) Now 'a' knows the result of the calculation (even if we, the audience, do not -- because it was "whispered" through the = sign -- which even *looks* like a little pipe). ====== Useful passage from the docs (sys module):stdin stdout stderr File objects corresponding to the interpreter's standard input, output and error streams. stdin is used for all interpreter input except for scripts but including calls to input() and raw_input() . stdout is used for the output of print and expression statements and for the prompts of input() and raw_input(). The interpreter's own prompts and (almost all of) its error messages go to stderr. stdout and stderr needn't be built-in file objects: any object is acceptable as long as it has a write() method that takes a string argument. (Changing these objects doesn't affect the standard I/O streams of processes executed by os.popen(), os.system() or the exec*() family of functions in the os module.) ===== You could show students how it's possible to redirect output from the print statement, from the terminal to a file, simply by changing the value of stdout. Python 2.2.2 (#37, Oct 14 2002, 17:02:34) [MSC 32 bit (Intel)] on win32 Type "copyright", "credits" or "license" for more information. IDLE 0.8 -- press F1 for help >>> import sys >>> sys.stdout >>> newout = open("somefile.txt","w") >>> sys.stdout = newout >>> print 'The rain in spain stays mainly in the plain' >>> newout.close() Note that output from the print statement will have gone to a text file, which may now be examined in a text editor. Note also the PyShell.PseudoFile reference. Again, from Python's point of view, stdout is just a pipe to someplace -- it's just like writing to a file, but in this case the "file" is a pseudo-file, i.e. is really the terminal window itself (which scrolls, just like paper, i.e. the metaphor of "file" is intact, given the terminal window looks at a scrollable document). Kirby From ajsiegel@optonline.net Sat Feb 15 22:37:26 2003 From: ajsiegel@optonline.net (Arthur) Date: Sat, 15 Feb 2003 17:37:26 -0500 Subject: [Edu-sig] re: Alice update Message-ID: <000601c2d542$d10eef90$2002a8c0@Arts> >What I read is: >* Scripting in Alice is done with the Python scripting language so you >may want to read the Pyhton Tutorial. [sic -- their typo not mine] Truthfully, I missed that. But I had downloaded the new Alice and looked for anything clearly about scripting in the tutorial or interface or the link to documentation - and found nothing. The same will generall be true for anyone else who goes there. I do now see that there that is a preference to turn on to allow scripting - which is turned off by default. I turn it on, try to "edit" an existing demo world, and am met with a blank screen. I guess once one invests in learning the Alice api, one can proceed to type something there. But the fact is I am wrong. There is a scripting facility there. And while I still dislike what I am seeing there, fervently, I guess my claim that no Python connection is in fact wrong. Damn. Arthur From urnerk@qwest.net Sat Feb 15 23:15:53 2003 From: urnerk@qwest.net (Kirby Urner) Date: Sat, 15 Feb 2003 15:15:53 -0800 Subject: [Edu-sig] re: Alice update In-Reply-To: <000601c2d542$d10eef90$2002a8c0@Arts> Message-ID: <5.2.0.9.0.20030215151307.024a9d68@pop.ptld.qwest.net> At 05:37 PM 2/15/2003 -0500, you wrote: >And while I still dislike what I am seeing there, fervently, I guess my >claim that no Python connection is in fact wrong. > >Damn. > >Arthur Hah. I enjoy your viewpoint, even if it's not mine. Kirby From ajsiegel@optonline.net Sat Feb 15 23:24:39 2003 From: ajsiegel@optonline.net (Arthur) Date: Sat, 15 Feb 2003 18:24:39 -0500 Subject: [Edu-sig] re: Alice update Message-ID: <000601c2d549$69db64f0$2002a8c0@Arts> >And while I still dislike what I am seeing there, fervently, I guess my >claim that no Python connection is in fact wrong. I should amend even that a bit. I don't dislike what I am seeing so much -as I dislike the pretensions connected to it. I don't think Alice can be considered a serious tool for 3d world authoring in comparison to, for example: http://www.adobe.com/products/atmosphere/main.html# and many others, free and commericial, open sourced and closed. Nor as introduction to programming - other than in name. The hostility is largely out of fear. That it might in fact somehow "win". Considering the funding and the prestige of the institution in which it is based. The subject - I'm sure - appears to be a personal obsession. Which is true enough. To the extent I am talking about the specifcs here, its not something worth getting worked up about. But it is also to me a broad and symbolic issue. To me, Alice represents much that it is anti-thesis to the Open Source worldview - as I interpet it and as I experience it. And this seems so apparent to me, that I am dumbfounded when I feel there is no one else within earshot who sees it like I do, or is at least, is willing say so. Art Art From hancock@anansispaceworks.com Sun Feb 16 09:48:39 2003 From: hancock@anansispaceworks.com (Terry Hancock) Date: Sun, 16 Feb 2003 01:48:39 -0800 Subject: [Edu-sig] re: Alice update In-Reply-To: <000601c2d549$69db64f0$2002a8c0@Arts> References: <000601c2d549$69db64f0$2002a8c0@Arts> Message-ID: On Saturday 15 February 2003 03:24 pm, Arthur wrote: > But it is also to me a broad and symbolic issue. To me, Alice represents > much that it is anti-thesis to the Open Source worldview - as I interpet it > and as I experience it. I was disappointed to find the absence of a source distribution, because I had thought that they were using a python applet interpreter or at least the makings of one. I did inquire about this, and I was told that there was some intent of releasing the source "eventually", but who knows when that will actually happen. In any case, it apparently doesn't work the way I thought I understood it to, so it wasn't what I was looking for anyway. I have not tried it (for one thing, I lack a Windows system to test it on). But I did poke around the site a bit, there is some interesting information regarding interface design. I found that part interesting: http://www.alice.org/stage3/aliceproj.html Also, there is a link to an open source implementation of most of Alice's features, "Squeak Alice" (maybe I'll get a chance to try that version out): http://www.alice.org/stage3/sqalice.html As for whether it is stylistically antithetical to open-source principles ... well, I'm not sure I understand what you mean (Which might be because I haven't tried it, of course). People have a lot of different ideas about how people and machines should interact -- I think a diversity of approaches is probably a good thing. Cheers, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com "Some things are too important to be taken seriously" From ajsiegel@optonline.net Sun Feb 16 15:12:42 2003 From: ajsiegel@optonline.net (Arthur) Date: Sun, 16 Feb 2003 10:12:42 -0500 Subject: [Edu-sig] re: Alice update Message-ID: <000501c2d5cd$db140710$2002a8c0@Arts> >I was disappointed to find the absence of a source >distribution, because I had thought that they were using >a python applet interpreter or at least the makings of one. >I did inquire about this, and I was told that there was some >intent of releasing the source "eventually", but who knows >when that will actually happen. Its been around for ten years or so. Eventually. It has a copy of the lgpl license in the root directory. I don't know much about this stuff, but I thought lpgl requires the release of source. But why worry about those kinds of things, when we are - ho, hum - in the presence of a new paradigm. """ Thirty years have since passed and we are proposing a new paradigm for human-computer interaction. We are building systems that aid cognitive processing and retention of information rather than focusing only on information manipulation. Working with perceptual and cognitive psychologists, as well as architects, designers, and artists, our goal is to deduce general design principles to produce the next generation of information systems, which we call InfoCockpits. "" I won't go on too much. Because in the end there is really is only one thing missing from the Alice project. Integrity. Art From j.posner@accurev.com Sun Feb 16 19:00:54 2003 From: j.posner@accurev.com (John Posner (AccuRev)) Date: Sun, 16 Feb 2003 14:00:54 -0500 Subject: [Edu-sig] RE: Edu-sig digest, Vol 1 #651 - 10 msgs In-Reply-To: <20030216170005.10770.9378.Mailman@mail.python.org> Message-ID: This is a multi-part message in MIME format. ------=_NextPart_000_0002_01C2D5C3.D2F38970 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable ## =20 ## Seems to me the only thing to do is to show a few alternate=20 ## cases, such as assigning a function result to a variable: ## =20 ## >>> def pfunc(): ## ... print 'a' ## ...=20 ## >>> def rfunc(): ## ... return 'a' ## ...=20 ## >>> pfunc() ## a ## >>> a =3D pfunc() ## a I think it's vitally important for programming students to learn the difference between a function's RETURN VALUE and such "side-effects" as OUTPUT (to stdout, to a file, etc.) To my mind, it would be = pedagogically superior to clearly identify a returned value that is sent to the = console: >>> def rfunc(): print 12.5 >>> rfunc() return value: 12.5 (Only a Python-aware console -- e.g. IDLE, not a DOS window -- could do this.) Compare this with the current behavior of Python IDEs (all of = them?): >>> rfunc() 12.5 In this example, the return value is numeric. So the programming student isn't given any visual clue as to the difference between a RETURN VALUE = and OUTPUT to stdout. (If the return value were a string, as in Terry = Hancock's example, the student would see a value enclosed in quotes. This is a = clue, but one that's easy to miss and doesn't apply to all data types.) One way to implement this (does it already exist?) would be to have the Python IDE support a user-settable "return value prefix". Whenever a = value is returned to the top level, the prefix (such as "return value: " in my example above) would be displayed by the IDE before the value itself. I'd also put in a toggle switch to enable/suppress display of: return value: None ... which some students might tire of before too long. Mini-flame: Terry, I think there's a bit of perversity in your example: (1) >>> def pfunc(): (2) print 'a' (3) (4) >>> a =3D pfunc() (5) a In line 4, you chose to name the assigned-to variable "a", because the variable is (erroneously) expected to get the value "a". This is a neat shorthand for experienced programmers, but it's the kind of thing that confuses students. Distinguishing between names of variables and the = values that get assigned to variables is just as important as distinguishing between functions' return values and their side-effect output. -John -- John Posner =D4=BF=D4=AC 102 Taylor Ave. Madison, CT 06443 jjposner@snet.net 203-245-2051 ------=_NextPart_000_0002_01C2D5C3.D2F38970 Content-Type: application/ms-tnef; name="winmail.dat" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="winmail.dat" eJ8+IjcTAQaQCAAEAAAAAAABAAEAAQeQBgAIAAAA5AQAAAAAAADoAAEIgAcAGAAAAElQTS5NaWNy b3NvZnQgTWFpbC5Ob3RlADEIAQ2ABAACAAAAAgACAAEGAAcAAQAAAAAAAAEGgAMADgAAANMHAgAQ AA4AAAAAAAAA+gABA5AGAIgLAAAtAAAACwACAAEAAAALACMAAAAAAAMAJgAAAAAACwApAAAAAAAD AC4AAAAAAAIBMQABAAAAGAAAAAAAAAAVdNWm1dTiQIv+S8vgGUk2BAcjAAMANgAAAAAAHgBwAAEA AAAlAAAARWR1LXNpZyBkaWdlc3QsIFZvbCAxICM2NTEgLSAxMCBtc2dzAAAAAAIBcQABAAAAFgAA AAHC1e1cafr2FDJ5KUL5lQeDAvJyVvMAAAIBHQwBAAAAGgAAAFNNVFA6Si5QT1NORVJAQUNDVVJF Vi5DT00AAAALAAEOAAAAAEAABg4AeL+a7dXCAQIBCg4BAAAAGAAAAAAAAAAVdNWm1dTiQIv+S8vg GUk2woAAAAMAFA4AAAAACwAfDgEAAAAeACgOAQAAAC4AAAAwMDAwMDAwMwFqLnBvc25lckBhY2N1 cmV2LmNvbQFwb3AuYWNjdXJldi5jb20AAAAeACkOAQAAAC4AAAAwMDAwMDAwMwFqLnBvc25lckBh Y2N1cmV2LmNvbQFwb3AuYWNjdXJldi5jb20AAAACAQkQAQAAAGMGAABf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QGAAADABAQAAAAAAMA ERAAAAAAHgAIEAEAAABlAAAAIyMjI1NFRU1TVE9NRVRIRU9OTFlUSElOR1RPRE9JU1RPU0hPV0FG RVdBTFRFUk5BVEUjI0NBU0VTLFNVQ0hBU0FTU0lHTklOR0FGVU5DVElPTlJFU1VMVFRPQVZBUklB QkxFOgAAAAD0Sg== ------=_NextPart_000_0002_01C2D5C3.D2F38970-- From glingl@aon.at Sun Feb 16 20:33:08 2003 From: glingl@aon.at (Gregor Lingl) Date: Sun, 16 Feb 2003 21:33:08 +0100 Subject: [Edu-sig] A mathematical teaser ... References: <20030216170005.10770.9378.Mailman@mail.python.org> Message-ID: <3E4FF584.1040104@aon.at> Hi educators! What strategy would you recommend, to solve the problem stated below? (For those of you who also read the tutor-list, please notice, that - although I posted this same problem there also - my *question* here is (intentionally) different). Thanks for letting me know your ideas Gregor The problem is taken from "Spektrum der Wissenschaft", Feb. 2003 (which is the German edition of Scientific American): Coded entry To cut costs for a doorguard who asks silly mathematical riddles, the union of mathematical logicians has devised a sophisticated locking apparatus for their union's home. The lock of the door is controlled by four simple switches, which are arranged in a square. The door opens if all the switches are "on" or if all of them are "off". When a member arrives to enter, the door always is locked, which means that some switches are in the on position and some are off. No one who wants to enter can see the switches or touch them directly. Instead, there are four buttons on the door, labelled "P", "D", "1" and "2". If you press "P", a pair of two switches in a horizontal or vertical row is randomly selected. If you press "D" a pair of diagonally arranged switches is randomly selected. After this selection has taken place, pushing button "1" randomly selects one of the previously selected switches and changes its position. Contrary to that, pushing "2" switches both of them. The sequence "letter, digit" may be repeated until the door opens (or you lose patience). Find the shortest complete code which opens the door with certainty, regardless of the original position of the four switches. From ajsiegel@optonline.net Mon Feb 17 19:56:08 2003 From: ajsiegel@optonline.net (Arthur) Date: Mon, 17 Feb 2003 14:56:08 -0500 Subject: [Edu-sig] re: Interactive interpreter: expressions vs. statements Message-ID: <000701c2d6be$9d8f9c00$2002a8c0@Arts> John writes - >I think it's vitally important for programming students to learn the difference between a function's RETURN VALUE and such "side-effects" as OUTPUT (to stdout, to a >file, etc.) I agree that the fundamental concepts here are more elusive to the beginner than might be suspected by those to whom it has become second nature. But I am not sure I think of it as a "expression vs. statement" issue. Because I guess I don't know how to think in those terms. Return value vs. side effecxts is a clearer concept to me - though, yes, it took some time before it became clear. A concrete example, with which Kirby happens to be familiar, was as to a Python beginner exploring VPython. He got stuck at the equivalent of: >>> from visual import * >>> def ball(incolor): sphere(color=incolor) >>> ball_1=ball(color.blue) #a blue sphere appears in a VPython window as expected #But he expects this command to move the center of the sphere to coords 1,0,0 \ >>> ball_1.pos=(1,0,0) # and gets >>> Traceback (most recent call last): >>> File "", line 1, in ? >>> ball_1.pos=(1,0,0) >>> AttributeError: 'NoneType' object has no attribute 'pos' He apparaently struggled with this for some time before screaming for help. When we told him: def ball(incolor): return sphere(color=incolor) was what he was looking for, and why, it was to be a big revelation - helping to put a whole host of issues in place for him. He was thrilled. [ It also confirmed to me that VPython is a great way to get people started and to illustrate basic principles, with the immediate visual feedback. I know I have mentioned that 100 times before, but here I can offer a concrete and real case, rather than one of my Zen intuitions. *I* don't need that kind of confirmation, of course - but others seem to call for it. :) ] Art From j.posner@accurev.com Mon Feb 17 20:08:37 2003 From: j.posner@accurev.com (John Posner (AccuRev)) Date: Mon, 17 Feb 2003 15:08:37 -0500 Subject: [Edu-sig] Bad message format Message-ID: This is a multi-part message in MIME format. ------=_NextPart_000_0009_01C2D696.72CE5B00 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit My apologies for the format of my previous message, which went through MIME hades on its way to the list. No more cut-and-paste! -John Posner ------=_NextPart_000_0009_01C2D696.72CE5B00 Content-Type: application/ms-tnef; name="winmail.dat" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="winmail.dat" eJ8+IiUUAQaQCAAEAAAAAAABAAEAAQeQBgAIAAAA5AQAAAAAAADoAAEIgAcAGAAAAElQTS5NaWNy b3NvZnQgTWFpbC5Ob3RlADEIAQ2ABAACAAAAAgAC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AAAAAA9Rg== ------=_NextPart_000_0009_01C2D696.72CE5B00-- From glingl@aon.at Mon Feb 17 23:15:38 2003 From: glingl@aon.at (Gregor Lingl) Date: Tue, 18 Feb 2003 00:15:38 +0100 Subject: [Edu-sig] re: Interactive interpreter: expressions vs. statements References: <000701c2d6be$9d8f9c00$2002a8c0@Arts> Message-ID: <3E516D1A.7030602@aon.at> Arthur schrieb: >John writes - >... > >He got stuck at the equivalent of: > > >>>>from visual import * >>>>def ball(incolor): >>>> >>>> > sphere(color=incolor) > > >>>>ball_1=ball(color.blue) >>>> >>>> > >#a blue sphere appears in a VPython window as expected > >#But he expects this command to move the center of the sphere to coords >1,0,0 >\ > > >>>>ball_1.pos=(1,0,0) >>>> > ># and gets > > >>>>Traceback (most recent call last): >>>> File "", line 1, in ? >>>> ball_1.pos=(1,0,0) >>>> AttributeError: 'NoneType' object has no attribute 'pos' >>>> >>>> > >He apparaently struggled with this for some time before screaming for help. > >When we told him: > >def ball(incolor): > return sphere(color=incolor) > >was what he was looking for, and why, it was to be a big revelation - >helping to put a whole host of issues in place for him. He was thrilled. > > > Agreeing completely with this, I'd like to stress, that this can made clear to the beginner, by stating the following rule(s) - which I formulate in a (probably) somewhat pradoxical way: (1) *Every function* returns a value (more exactly: a reference to an object), regardless of what the programmer's intention is. If program execution doesn't return via a return statement with an argument, the function returns the None - Object. In the case above one can easily observe this by trying: >>> print ball(color.blue) None (2) *Some functions* do something more - side-effects like printing, drawing, assigning..., *if* the programmer prescribes this by writing the corresponding statements into the function's body. Gregor >[ >It also confirmed to me that VPython is a great way to get people started >and to illustrate basic principles, with the immediate visual feedback. I >know I have mentioned that 100 times before, but here I can offer a concrete >and real case, rather than one of my Zen intuitions. > >*I* don't need that kind of confirmation, of course - but others seem to >call for it. :) > ] > >Art > > >_______________________________________________ >Edu-sig mailing list >Edu-sig@python.org >http://mail.python.org/mailman/listinfo/edu-sig > > > > From jiescobar@net-uno.net Tue Feb 18 02:13:13 2003 From: jiescobar@net-uno.net (Javier Escobar) Date: Mon, 17 Feb 2003 22:13:13 -0400 Subject: [Edu-sig] Oregon Curriculum In-Reply-To: Message-ID: Hi Terry, thanks for your feedback. You have a lot of ideas. I would like to see how you develop them. For me, it is necessary to define the physics course the programing workshop will be related to. In other words, this project will be associated with a universitary physics course. I think suggestion #1 is a good example in which computer programming is useful to solve physics problems. I will have it in mind. -----Mensaje original----- De: Terry Hancock [mailto:hancock@anansispaceworks.com] Enviado el: Miércoles, 12 de Febrero de 2003 05:30 a.m. Para: Javier Escobar CC: edu-sig@python.org Asunto: Re: [Edu-sig] Oregon Curriculum Hi Javier, On Tuesday 11 February 2003 06:35 pm, Javier Escobar wrote: > I would like to receive some comments, ideas, sugestions. > At this point, I'm just figuring out the most general ideas about the work, > and I haven´t started jet using Python. [...] > I'm involved in teaching physics. Well, you understand this is totally self-interested, but I would really like to see some of the following things (or find them if they already exist). I suspect that PyGame would come in handy for doing them, though there may be other options: 1) 2-D (or projected 3-D) n-body integrator for orbital mechanics demos. Especially a good interface for inputing objects, masses, and velocities of test objects. 2) A flat-space demonstrator of some kind -- basically like "Asteroids" but a little more straightforward, and possibly 3-D subjective. A docking simulator would fit really well. 3) Something that deals with the launch + staging problem -- with or without atmospheric drag considerations, but definitely considering ground collision. Probably a 2-D simulation is best. 4) Ballistic lander sim in 3-D (e.g. maybe building on FlightGear). 5) Use rocket nozzle parameters, fuel+oxy, and other physical parameters to compute thrust and specific impulse of an engine. That is, a rocket engine design simulation. These would all figure into a series of space technology classes we are planning to teach. Eventually, I'd probably plan to write them myself, but you did ask for suggestions. ;-) Obviously, a really cool program could put all these together in one simulator, but that sounds pretty complicated to me. I think a simple sim for each concept is probably better. Cheers, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com From christian.mascher@gmx.de Tue Feb 18 17:27:39 2003 From: christian.mascher@gmx.de (Christian Mascher) Date: Tue, 18 Feb 2003 18:27:39 +0100 Subject: [Edu-sig] A mathematical teaser ... References: <20030217170015.25554.57916.Mailman@mail.python.org> Message-ID: <3E526D0A.A4E0524A@gmx.de> > From: Gregor Lingl > > > What strategy would you recommend, to solve the problem stated below? > (For those of you who also read the tutor-list, please notice, that - > although > I posted this same problem there also - my *question* here is > (intentionally) > different). Hi, thanks for the interesting problem. How does one get started on a way to a solution? This is what I did (without a computer, but perhaps with some programming experience involved): [In case you want to do it youself: don't read on.] (no-spoiler space) a) visualize, find a short representation: The state of the lock can be represented by four binary digits in an 2-2-array like this: 0 0 or 1 0 1 1 1 1 b) classify: I wrote down all possible combinations for a locked state. These can be grouped into three classes: type 1: array contains only a single 0 or only a single 1 type 2p: array contains two parallel 0 and two parallel 1 like in 00 11 type 2d: array contains two diagonal 0 and 1 like in 01 10 I made the distinction between 2p and 2d later, when I realized how the operations work on these types. At first I started with just two classes/types. Type 1 came quite naturally, because 0 and 1 can be interchanged without changing the problem. c) analyse the operations on the types: How do the four different operations P1,P2,D1 and D2 change the type. By looking at the visual arrays, one sees that D2 is quite special: If D2 works on type 2d, the lock opens. If it works on type 1 or 2p, it leaves them in their respective class. Now its quite clear how to get a solution. The last bit was working out a graph - a sort of seaving procedure - where you start with any state, then use D2, coming to type 1 or 2p (when you haven't opend the lock already), use P2 to go to type 1 or 2d and so on. Symbolically: 1,2p,2d -->D2--> 1,2p -->P2--> 1,2d -->D2--> 1 -->(D1 or P1)-->2p,2d -->D2--> 2p -->P2--> 2d -->D2--> open. I think this is the shortest path, but haven't proven it rigorously. Greetings, Christian > > Thanks for letting me know your ideas > Gregor > > The problem is taken from "Spektrum der Wissenschaft", Feb. 2003 (which > is the German edition of Scientific American): > > Coded entry > > To cut costs for a doorguard who asks silly mathematical riddles, the union > of mathematical logicians has devised a sophisticated locking apparatus for > their union's home. > The lock of the door is controlled by four simple switches, which are > arranged in a square. The door opens if all the switches are "on" or if all > of them are "off". When a member arrives to enter, the door always is > locked, which means that some switches are in the on position and some are > off. > No one who wants to enter can see the switches or touch them directly. > Instead, there are four buttons on the door, labelled "P", "D", "1" and > "2". > If you press "P", a pair of two switches in a horizontal or vertical row is > randomly selected. If you press "D" a pair of diagonally arranged switches > is randomly selected. > After this selection has taken place, pushing button "1" randomly selects > one of the previously selected switches and changes its position. > Contrary to that, > pushing "2" switches both of them. The sequence "letter, digit" may be > repeated until the door opens (or you lose patience). > Find the shortest complete code which opens the door with certainty, > regardless of the original position of the four switches. > From christian.mascher@gmx.de Tue Feb 18 18:17:40 2003 From: christian.mascher@gmx.de (Christian Mascher) Date: Tue, 18 Feb 2003 19:17:40 +0100 Subject: [Edu-sig] A mathematical teaser ... Message-ID: <3E5278C4.155ADCB2@gmx.de> Christian Mascher wrote: >> - a sort of seaving procedure - please read "sieving". Sorry, Christian From glingl@aon.at Tue Feb 18 21:59:59 2003 From: glingl@aon.at (Gregor Lingl) Date: Tue, 18 Feb 2003 22:59:59 +0100 Subject: [Edu-sig] A mathematical teaser ... References: <20030217170015.25554.57916.Mailman@mail.python.org> <3E526D0A.A4E0524A@gmx.de> Message-ID: <3E52ACDF.1050104@aon.at> Thanks for your explanations - you arrived ad the right result, as e. g. a program, done by Tim Peters, shows. Hava look at the corresponding thread at tutor@python.org list: http://mail.python.org/pipermail/tutor/2003-February/020846.html (This is only one of the messages of the thread, which you can find at http://mail.python.org/pipermail/tutor/2003-February/thread.html ) Regards Gregor Lingl Christian Mascher schrieb: >>From: Gregor Lingl >> >> >>What strategy would you recommend, to solve the problem stated below? >>(For those of you who also read the tutor-list, please notice, that - >>although >>I posted this same problem there also - my *question* here is >>(intentionally) >>different). >> >> > > >Hi, > >thanks for the interesting problem. How does one get started on a way to >a solution? This is what I did (without a computer, but perhaps with >some programming experience involved): > > >[In case you want to do it youself: don't read on.] > > >(no-spoiler space) > > > > > > > > > > > >a) visualize, find a short representation: > >The state of the lock can be represented by four binary digits in an >2-2-array like this: > 0 0 or 1 0 > 1 1 1 1 > >b) classify: > >I wrote down all possible combinations for a locked state. These can be >grouped into three classes: > > type 1: array contains only a single 0 or only a single 1 > > type 2p: array contains two parallel 0 and two parallel 1 > like in 00 > 11 > type 2d: array contains two diagonal 0 and 1 > like in 01 > 10 > >I made the distinction between 2p and 2d later, when I realized how the >operations work on these types. At first I started with just two >classes/types. Type 1 came quite naturally, because 0 and 1 can be >interchanged without changing the problem. > >c) analyse the operations on the types: > >How do the four different operations P1,P2,D1 and D2 change the type. By >looking at the visual arrays, one sees that D2 is quite special: >If D2 works on type 2d, the lock opens. >If it works on type 1 or 2p, it leaves them in their respective class. >Now its quite clear how to get a solution. > >The last bit was working out a graph - a sort of seaving procedure - >where you start with any state, then use D2, coming to type 1 or 2p >(when you haven't opend the lock already), use P2 to go to type 1 or 2d >and so on. Symbolically: > >1,2p,2d -->D2--> 1,2p -->P2--> 1,2d -->D2--> 1 -->(D1 or P1)-->2p,2d >-->D2--> 2p -->P2--> 2d -->D2--> open. > >I think this is the shortest path, but haven't proven it rigorously. > >Greetings, > >Christian > > > > > >>Thanks for letting me know your ideas >>Gregor >> >>The problem is taken from "Spektrum der Wissenschaft", Feb. 2003 (which >>is the German edition of Scientific American): >> >>Coded entry >> >>To cut costs for a doorguard who asks silly mathematical riddles, the union >>of mathematical logicians has devised a sophisticated locking apparatus for >>their union's home. >>The lock of the door is controlled by four simple switches, which are >>arranged in a square. The door opens if all the switches are "on" or if all >>of them are "off". When a member arrives to enter, the door always is >>locked, which means that some switches are in the on position and some are >>off. >>No one who wants to enter can see the switches or touch them directly. >>Instead, there are four buttons on the door, labelled "P", "D", "1" and >>"2". >>If you press "P", a pair of two switches in a horizontal or vertical row is >>randomly selected. If you press "D" a pair of diagonally arranged switches >>is randomly selected. >>After this selection has taken place, pushing button "1" randomly selects >>one of the previously selected switches and changes its position. >>Contrary to that, >>pushing "2" switches both of them. The sequence "letter, digit" may be >>repeated until the door opens (or you lose patience). >>Find the shortest complete code which opens the door with certainty, >>regardless of the original position of the four switches. >> >> >> > > >_______________________________________________ >Edu-sig mailing list >Edu-sig@python.org >http://mail.python.org/mailman/listinfo/edu-sig > > > > From ajsiegel@optonline.net Wed Feb 19 01:51:29 2003 From: ajsiegel@optonline.net (Arthur) Date: Tue, 18 Feb 2003 20:51:29 -0500 Subject: [Edu-sig] progress Message-ID: <004601c2d7b9$6c6fc0e0$2002a8c0@Arts> Just to report some progress and peacemaking on one front, at least. Bruce Sherwood on the vpython-users list. >I enjoyed working/playing today with the distutils package Arthur so >helpfully provided. This was on Windows, making and testing binary >installers, with and without IDLE, etc. Very nice, very convenient. Even >does a perfect job of cleaning up on an uninstall from the "Add/remove >program" control panel. He is actually being quite reasonable in talking about substantial rethinking of the VPython distribution, and to a more "community" based approach to the future of VPython in general. Certainly the fact that I was able to bring something concrete to the table with a worked out setup.py was a major help. Art Art From jiescobar@net-uno.net Thu Feb 20 01:51:09 2003 From: jiescobar@net-uno.net (Javier Escobar) Date: Wed, 19 Feb 2003 21:51:09 -0400 Subject: [Edu-sig] Python promises a revolution Message-ID: Hi freinds, Yesterday my undergraduate proyect on "teaching physics with Python" was presented to the profesors who will work with me. They were very excited about Python as an alternative language to introduce physics students to programming. This will be done at the Central University of Venezuela. The profesors working with me didn't know anything about Python, but they were very interested in this language as an alternative to C, language that is being used at the introductory course to programming for undergraduate physics students. My undergraduate work has to be done having a pedagogical aproach to physics. The structure of the work I presented is the following: ALTERNATIVE CONCEPTIONS - Problem definition (What are alternative conceptions in science, how do they affect physiscs teaching) - Alternative conceptions and Constructivism (Alternative conceptions viewed from a pedagogical theory point of view) - Proposed solutions (solutions proposed to deal with the alternative conceptions problem) OUR PROPOSITION - Computer programming and physics teaching (How can computer programing help dealing with alternative conception in physics teaching) - Python as a programming language (What is Phython) - ¿Why Phython? (Features that make phython an ideal language for physics teaching) - Design of a programming course for undergraduate physics students. I will appreciate your comments. I'm beginning to work on every subject of this table of contents. From michael.williams@st-annes.oxford.ac.uk Thu Feb 20 02:00:00 2003 From: michael.williams@st-annes.oxford.ac.uk (Michael Williams) Date: Thu, 20 Feb 2003 02:00:00 +0000 Subject: [Edu-sig] Python promises a revolution In-Reply-To: Message-ID: <04B10222-4477-11D7-8886-000393C5BF0A@st-annes.oxford.ac.uk> On Thursday, February 20, 2003, at 01:51 am, Javier Escobar wrote: > OUR PROPOSITION > - Computer programming and physics teaching (How can computer=20 > programing > help dealing with alternative conception in physics teaching) > - Python as a programming language (What is Phython) > - =BFWhy Phython? (Features that make phython an ideal language for=20 > physics > teaching) > - Design of a programming course for undergraduate physics students. > > I will appreciate your comments. I'm beginning to work on every=20 > subject of > this table of contents. I did a Masters dissertation on the last two of these points last year=20= in the department of physics at the University of Oxford here in the=20 UK. You may find the dissertation and the teaching materials I produced=20= useful: http://users.ox.ac.uk/~sann1276/python/ --=20 Michael From p.kent@mail.com Thu Feb 20 11:29:11 2003 From: p.kent@mail.com (Phillip Kent) Date: Thu, 20 Feb 2003 11:29:11 +0000 Subject: [Edu-sig] Python promises a revolution In-Reply-To: Message-ID: <5.1.0.14.2.20030220112005.00b87700@smtp1.mail.com> At 21:51 19/02/2003 -0400, Javier Escobar wrote:


ALTERNATIVE CONCEPTIONS
- Problem definition (What are alternative conceptions in science, how do
they affect physiscs teaching)
- Alternative conceptions and Constructivism (Alternative conceptions viewed
from a pedagogical theory point of view)
- Proposed solutions (solutions proposed to deal with the alternative
conceptions problem)

OUR PROPOSITION
- Computer programming  and physics teaching (How can computer programing
help dealing with alternative conception in physics teaching)
- Python as a programming language (What is Phython)
- =BFWhy Phython? (Features that make phython an ideal language for physics
teaching)
- Design of a programming course for undergraduate physics=20 students.


Hi Javier,

On the more 'educational research' side, I strongly recommend to have a look at the work of:

Bruce Sherin on programming as an 'alternative algebra' for physics [http://www.ls.sesp.nwu.edu/people/faculty/bsherin.html]

and

Andrea diSessa [
http://dewey.soe.berkeley.edu/~boxer/]

who has been working in this area since the late 70s - the papers are a bit hard to get hold of, but his recent book Changing Minds (MIT Press, 2000) is accessible and a good introductory read. Also have a look at Abelson & diSessa Turtle Geometry: The Computer as a Medium for Exploring Mathematics (MIT Press 1981) which starts very simple but ends up exploring non-Euclidean 4-D geometries.

- Phillip


++++++
Dr Phillip Kent, London, UK
mathematics  education  technology  research
p.kent@mail.com      mobile: 07950 952034
++++++ From urnerk@qwest.net Thu Feb 20 22:47:58 2003 From: urnerk@qwest.net (Kirby Urner) Date: Thu, 20 Feb 2003 14:47:58 -0800 Subject: [Edu-sig] Python promises a revolution In-Reply-To: <04B10222-4477-11D7-8886-000393C5BF0A@st-annes.oxford.ac.uk > References: Message-ID: <5.2.0.9.0.20030220144334.011aaeb0@pop.ptld.qwest.net> At 02:00 AM 2/20/2003 +0000, you wrote: >I did a Masters dissertation on the last two of these points last year in >the department >of physics at the University of Oxford here in the UK. You may find the >dissertation >and the teaching materials I produced useful: > >http://users.ox.ac.uk/~sann1276/python/ >-- >Michael I notice you avoid exposing students to the concept of a class, i.e. the OOP paradigm is put off in favor of a more procedural approach. Is this because you think user-defined classes (types) are too difficult for beginning students, or perhaps simply that they're less relevant to programming applications in physics? Or maybe I missed seeing it in your well-organized and clearly presented tutorial (above). Kirby From michael.williams@st-annes.oxford.ac.uk Thu Feb 20 23:01:03 2003 From: michael.williams@st-annes.oxford.ac.uk (Michael Williams) Date: Thu, 20 Feb 2003 23:01:03 +0000 Subject: [Edu-sig] Python promises a revolution In-Reply-To: <5.2.0.9.0.20030220144334.011aaeb0@pop.ptld.qwest.net> Message-ID: <2F9E20FD-4527-11D7-8886-000393C5BF0A@st-annes.oxford.ac.uk> On Thursday, February 20, 2003, at 10:47 pm, Kirby Urner wrote: >> I did a Masters dissertation on the last two of these points last >> year in the department >> of physics at the University of Oxford here in the UK. You may find >> the dissertation >> and the teaching materials I produced useful: >> >> http://users.ox.ac.uk/~sann1276/python/ >> -- >> Michael > > I notice you avoid exposing students to the concept of a class, > i.e. the OOP paradigm is put off in favor of a more procedural > approach. Is this because you think user-defined classes (types) > are too difficult for beginning students, or perhaps simply that > they're less relevant to programming applications in physics? > Or maybe I missed seeing it in your well-organized and clearly > presented tutorial (above). A bit of both. We've only got four half-day sessions to cover the exercises in the handbook *and* a more substantial problem, so anything we can comfortably lose without sacrificing useful background we do. OOP is a sufficiently discrete topic that we can either take it or leave it. So it's not just that it's hard, but also that it's big. I think the procedural paradigm is much more graspable and intuitive to our students, who are used to working through iterative calculations by hand. Doing OOP properly would add at least a half-day (and probably more if we did it properly) to the handbook. And you're right about its limited applications in Physics. None of our exercises are best-solved using the OO paradigm, and we think they're reasonably representative of the day-to-day numerical methods grunt work of a physicist. Of course in an ideal work we'd cover other applications that do lend themselves to the OO approach, such as modeling solid state systems. You win some, you lose some ;-> -- Michael From urnerk@qwest.net Fri Feb 21 00:57:57 2003 From: urnerk@qwest.net (Kirby Urner) Date: Thu, 20 Feb 2003 16:57:57 -0800 Subject: [Edu-sig] Python promises a revolution In-Reply-To: <2F9E20FD-4527-11D7-8886-000393C5BF0A@st-annes.oxford.ac.uk > References: <5.2.0.9.0.20030220144334.011aaeb0@pop.ptld.qwest.net> Message-ID: <5.2.0.9.0.20030220162353.02424f70@pop.ptld.qwest.net> At 11:01 PM 2/20/2003 +0000, Michael Williams wrote: >A bit of both. We've only got four half-day sessions to cover the >exercises in the handbook *and* a more substantial problem, so >anything we can comfortably lose without sacrificing useful background >we do. OOP is a sufficiently discrete topic that we can either take it >or leave it. So it's not just that it's hard, but also that it's big. >I think the procedural paradigm is much more graspable and intuitive >to our students, who are used to working through iterative calculations >by hand. Doing OOP properly would add at least a half-day (and probably >more if we did it properly) to the handbook. > >And you're right about its limited applications in Physics. None of >our exercises are best-solved using the OO paradigm, and we think >they're reasonably representative of the day-to-day numerical methods >grunt work of a physicist. > >Of course in an ideal work we'd cover other applications that do lend >themselves to the OO approach, such as modeling solid state systems. >You win some, you lose some ;-> >-- >Michael Yes, I can see where you'd need to be realistic about the time constraint. In some hypothetical future, students will be more prepared with a language coming in, because of this idea that computer languages provide an alternative algebra for learning maths (I liked your apology for the 'math' module -- US English spelling i.e. a singular instead of a plural noun). Given the favorable press, that computing with objects is supposed to let you think more in terms of the problem domain, than in artificial terms imposed by the computer, it'd seem tempting to talk more generally about physics as a search for generalizations in the face of many "black box" objects (e.g. atoms), the inner workings of which we may probe and model, to build up a sense of what the properties and behaviors might be. >>> from atoms import Atom, Neutron, Proton >>> v = Atom(p=7,n=7) >>> v.name() Nitrogen-14 >>> v = v + Neutron # hit by cosmic ray >>> v = v - Proton # proton goes flying >>> v Carbon-14 >>> v.radioactive() True >>> v.halflife(unit = 'years') 5700 A reason for talking about objects even in an intro course is it gives you access to generalizations about the Python primitives and helps explain the object.method() or object.property syntax that one typically uses, even when not defining classes of one's own. E.g. given we're likely to talk about the differences among arrays, dictionaries, tuples, it makes sense to probe them as "black boxes", using dir(). >>> dir({}) # list guts of {}-object (dictionary) ['__class__', '__cmp__', '__contains__', '__delattr__', '__delitem__', '__doc__', '__eq__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__init__', '__iter__', '__le__', '__len__', '__lt__', '__ne__', '__new__', '__reduce__', '__repr__', '__setattr__', '__setitem__', '__str__', 'clear', 'copy', 'get', 'has_key', 'items', 'iteritems', 'iterkeys', 'itervalues', 'keys', 'popitem', 'setdefault', 'update', 'values'] I just thought of a good way to introduce the new 'set' type (new in 2.3). Use it to find what methods are common to lists and dictionaries (or any two primitives), vs. what methods are unique to each. set primitives will make this easy. Kirby From jiescobar@net-uno.net Fri Feb 21 01:53:34 2003 From: jiescobar@net-uno.net (Javier Escobar) Date: Thu, 20 Feb 2003 21:53:34 -0400 Subject: [Edu-sig] Python promises a revolution In-Reply-To: <04B10222-4477-11D7-8886-000393C5BF0A@st-annes.oxford.ac.uk> Message-ID: William, thanks for that link. I'm checking it out, I´ll comment latter on them. -----Mensaje original----- De: Michael Williams [mailto:michael.williams@st-annes.oxford.ac.uk] Enviado el: Miércoles, 19 de Febrero de 2003 10:00 p.m. Para: Javier Escobar CC: edu-sig@python.org Asunto: Re: [Edu-sig] Python promises a revolution On Thursday, February 20, 2003, at 01:51 am, Javier Escobar wrote: > OUR PROPOSITION > - Computer programming and physics teaching (How can computer > programing > help dealing with alternative conception in physics teaching) > - Python as a programming language (What is Phython) > - ¿Why Phython? (Features that make phython an ideal language for > physics > teaching) > - Design of a programming course for undergraduate physics students. > > I will appreciate your comments. I'm beginning to work on every > subject of > this table of contents. I did a Masters dissertation on the last two of these points last year in the department of physics at the University of Oxford here in the UK. You may find the dissertation and the teaching materials I produced useful: http://users.ox.ac.uk/~sann1276/python/ -- Michael From michael.williams@st-annes.oxford.ac.uk Fri Feb 21 02:45:36 2003 From: michael.williams@st-annes.oxford.ac.uk (Michael Williams) Date: Fri, 21 Feb 2003 02:45:36 +0000 Subject: [Edu-sig] Python promises a revolution In-Reply-To: <5.2.0.9.0.20030220162353.02424f70@pop.ptld.qwest.net> Message-ID: <8E3ECC50-4546-11D7-8886-000393C5BF0A@st-annes.oxford.ac.uk> On Friday, February 21, 2003, at 12:57 am, Kirby Urner wrote: > A reason for talking about objects even in an intro course is it > gives you access to generalizations about the Python primitives > and helps explain the object.method() or object.property syntax > that one typically uses, even when not defining classes of one's > own. Indeed. A desire to use as little "magic" syntax as possible almost led us to make a brief explanation of objects for precisely this reason. Instead we relegated it to a footnote for the interested student: http://users.ox.ac.uk/~sann1276/python/handbook/node35.html#foot1321 (at the bottom), and discussed it in the dissertation: http://users.ox.ac.uk/~sann1276/python/report/node40.html -- Michael From be_well@linuxmail.org Fri Feb 21 10:47:59 2003 From: be_well@linuxmail.org (Will Well) Date: Fri, 21 Feb 2003 18:47:59 +0800 Subject: [Edu-sig] Well done is better than well said. Message-ID: <20030221104759.1164.qmail@linuxmail.org> Dear Candy, Hi, how are you? And the rest How's the job? any news? We're all fine. I had an eye check up and the doctor said my eyes are fine 20/20 with just a normal need for reading glasses due to age. How's your vision? Julie's ok now, but was in the hospital a couple of days a few weeks ago due to a very high fever. We all got scared although now relieved as tests proved everythings ok. I got a little job helping to run a small company selling Unix / Linux software and support. Interesting work and my colleague's a decent chap, so I'm glad. Doesn't pay much at all now since we're so small just two people but if we're clever enough with much work and perseverence we ought to be able to turn it around into a profitable business... its at least worth the effort for the time being. Please, say hello to everybody for me. Stay well and keep in touch, Yours sincerely, Larry -- The reward of a thing well done is to have done it. -- ______________________________________________ http://www.linuxmail.org/ Now with e-mail forwarding for only US$5.95/yr Powered by Outblaze From ajsiegel@optonline.net Sat Feb 22 01:55:58 2003 From: ajsiegel@optonline.net (Arthur) Date: Fri, 21 Feb 2003 20:55:58 -0500 Subject: [Edu-sig] re: Case sensitivity Message-ID: <002301c2da15$8ddb40c0$2002a8c0@Arts> > And so around and around we go, burning time and energy fruitlessly on a thread that will never give results because Guido's been frigthened by this newsgroup's > hostility on the subject. So it goes. Guess I was wrong in believing you were not going to go down this road. > But I hope that if some beginners ARE reading this thread, and starting to doubt of their sanity and common sense by hearing PRAISE of the wart that they are recognizing >as such, my words can hearten them: it IS a wart, you're right in disliking it, and you can "thank" attitudes such as this "remember to watch it" for its permanence. Guido succumbed to evidence. Which you will not let yourself succemb to. Beginners don't care. The only beginners - high schoolers - who had the nerve to post up here doing the debate, said so clearly. Their teachers overwhelmingly confirmed what they said. None of which speaks ultimately to the design issue, and what Alex prefers and why he prefers it. But it seems incredible that you would not overcome the temptation to press the beginner issue. Becuase that's exactly were the discussion went off track Round One, and will continue to go off track. You know what you know from your own experience. As I know from mine. And if I were working with twenty did API's a week, as you might be, I might see better your point. Its an advanced users issue, if its an issue at all. Art From ajsiegel@optonline.net Sat Feb 22 02:04:24 2003 From: ajsiegel@optonline.net (Arthur) Date: Fri, 21 Feb 2003 21:04:24 -0500 Subject: [Edu-sig] apologies Message-ID: <000d01c2da16$b963b410$2002a8c0@Arts> That last meant for python-list, not here. Promise. Art From micah@donsuemor.com Tue Feb 25 20:27:33 2003 From: micah@donsuemor.com (Micah Bedwell) Date: Tue, 25 Feb 2003 12:27:33 -0800 Subject: [Edu-sig] Test Message-ID: <002e01c2dd0c$548da430$0b01a8c0@donsuemor.com> This is a multi-part message in MIME format. --Boundary_(ID_h7TTa2NRORRZHf2E/CInvQ) Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT Anyone out there? Micah Bedwell System Administrator DonSueMor, Inc. Emeryville, CA. 94608 510.420.6943 micah@donsuemor.com --Boundary_(ID_h7TTa2NRORRZHf2E/CInvQ) Content-type: text/html; charset=iso-8859-1 Content-transfer-encoding: 7BIT

Anyone out there?

Micah Bedwell

System Administrator
DonSueMor, Inc.
Emeryville, CA. 94608

510.420.6943
micah@donsuemor.com

 
--Boundary_(ID_h7TTa2NRORRZHf2E/CInvQ)-- From rmangaliag@slu.edu.ph Wed Feb 26 10:29:22 2003 From: rmangaliag@slu.edu.ph (rmangaliag@slu.edu.ph) Date: Wed, 26 Feb 2003 18:29:22 +0800 Subject: [Edu-sig] sorry... but a question on xml... Message-ID: <1046255362.3e5c9702cd786@mbox.slu.edu.ph> are there xml/xsl formatting objects processor in python??? sori, if this is not the most appropriate sig to ask this question... but thanks... atleast for reading... :) ------------------------------------------------- Email Service Provided by SLU-Net Saint Louis University ( http://www.slu.edu.ph ) -------------------------------------------------