From praveen.patil@silver-software.com Wed Sep 4 13:28:49 2002 From: praveen.patil@silver-software.com (Praveen Patil) Date: Wed, 4 Sep 2002 13:28:49 +0100 Subject: [Edu-sig] Please help in calling python fucntion from 'c' Message-ID: This is a multi-part message in MIME format. ------=_NextPart_000_000E_01C25417.00D8E2B0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hi, I have written 'C' dll(MY_DLL.DLL) . I am importing 'C' dll in python file(example.py). I want to call python function from 'c' function. For your reference I have attached 'c' and python files to this mail. In my pc: python code is under the directory D:\test\example.py dll is under the directory C:\Program Files\Python\DLLs\MY_DLL.pyd Here are the steps I am following. step(1): I am calling 'C' function(RECEIVE_FROM_IL_S) from python. This 'C' function is existing imported dll(MY_DLL). step(2): I want to call python function(TestFunction) from 'C' function(RECEIVE_FROM_IL_S). Python code is(example.py) :- ---------------------------- import MY_DLL G_Logfile = None def TestFunction(): G_Logfile = open('Pytestfile.txt', 'w') G_Logfile.write("%s \n"%'I am writing python created text file') G_Logfile.close G_Logfile = None #end def TestFunction if __name__ == "__main__": MY_DLL.RECEIVE_FROM_IL_S(10,50) 'C' code is (MY_DLL.c) :- --------------------- #include #include #include PyObject* _wrap_RECEIVE_FROM_IL_S(PyObject *self, PyObject *args) { FILE* fp; PyObject* _resultobj; int i,j; if( !(PyArg_ParseTuple(args, "ii",&i,&j))) { return NULL; } fp= fopen("RECEIVE_IL_S.txt", "w"); fprintf(fp, "i=%d j=%d" , i,j); fclose(fp); /* Here I want to call python function(TestFunction). Please suggest me some solution*/ _resultobj = Py_None; return _resultobj; } static PyMethodDef MY_DLL_methods[] = { { "RECEIVE_FROM_IL_S", _wrap_RECEIVE_FROM_IL_S, METH_VARARGS }, { NULL , NULL} }; __declspec(dllexport) void __cdecl initMY_DLL(void) { Py_InitModule("MY_DLL",MY_DLL_methods); } Please anybody help me solving the problem. Cheers, Praveen. ------=_NextPart_000_000E_01C25417.00D8E2B0 Content-Type: text/plain; name="exampl.py" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="exampl.py" import MY_DLL G_Logfile = None def TestFunction(): G_Logfile = open('Pytestfile.txt', 'w') G_Logfile.write("%s \n"%'I am writing python created text file') G_Logfile.close G_Logfile = None #end def TestFunction if __name__ == "__main__": MY_DLL.RECEIVE_FROM_IL_S(10,50) ------=_NextPart_000_000E_01C25417.00D8E2B0 Content-Type: application/octet-stream; name="MY_DLL.c" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="MY_DLL.c" #include #include #include PyObject* _wrap_RECEIVE_FROM_IL_S(PyObject *self, PyObject *args) { FILE* fp; =20 PyObject* _resultobj; int i,j; =20 if( !(PyArg_ParseTuple(args, "ii",&i,&j))) { return NULL; } fp=3D fopen("RECEIVE_IL_S.txt", "w"); fprintf(fp, "i=3D%d j=3D%d" , i,j); fclose(fp); /* Here I want to call python function(TestFunction). Please suggest = me some solution*/ _resultobj =3D Py_None; return _resultobj; } static PyMethodDef MY_DLL_methods[] =3D { { "RECEIVE_FROM_IL_S", _wrap_RECEIVE_FROM_IL_S, METH_VARARGS }, { NULL , NULL} }; __declspec(dllexport) void __cdecl initMY_DLL(void) { Py_InitModule("MY_DLL",MY_DLL_methods); } ------=_NextPart_000_000E_01C25417.00D8E2B0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline [ The information contained in this e-mail is confidential and is intended for the named recipient only. If you are not the named recipient, please notify us by telephone on +44 (0)1249 442 430 immediately, destroy the message and delete it from your computer. Silver Software has taken every reasonable precaution to ensure that any attachment to this e-mail has been checked for viruses. However, we cannot accept liability for any damage sustained as a result of any such software viruses and advise you to carry out your own virus check before opening any attachment. Furthermore, we do not accept responsibility for any change made to this message after it was sent by the sender.] ------=_NextPart_000_000E_01C25417.00D8E2B0-- From Burley, Brent" Message-ID: <3D7634FD.60E97B1D@fa.disney.com> Praveen Patil wrote: > I want to call python function from 'c' function. The easiest way is this: PyRun_SimpleString("TestFunction()"); If you need to get return values back or if you want to run the code in other than the "__main__" module, you can use PyRun_String. If you need to pass in PyObjects to a function instead of just running a string, then you need to use PyObject_CallFunction. PyRun_String and PyRun_SimpleString are described here: http://www.python.org/doc/current/api/veryhigh.html PyObject_CallFunction is described here: http://www.python.org/doc/current/api/object.html#l2h-179 Brent From Jason Cunliffe" " Andew Glassner's Other Notebook" Message-ID: <004c01c255b8$5cf504a0$6501a8c0@vaio> Well here's another Summer 2002 edu-sig book gem: Andrew Glassner's Other Notebook Further Recreations in Computer Graphics - A practical guide to creative activities using computer graphics http://glassner.com/andrew/writing/books/other-notebook.htm Beautifully conceived, illustrated and written. Andrew Glassner is well know for his "Graphic Gems" series. It's rare to find a book which is so encouraging, helpful and facinating on computer graphics, yet without ever being sacrificed to local amming language dogma. This is above all about exploring the real world. Part of our 'real' world now includes computer graphics. The never loses sight of the wonderful scope between observation, analysis, synthesis and simulation. You could build and an entire course around this lucid book - and Python with its CLI and various graphics toolkits would be ideal [LightFlow, VPython etc.. the usual culprits] Here's two quick excerpts from the intro: "One of the things I find most appealing about computer graphics is that it's a gateway for discovering all sorts of other subjects. From the structure of soap bubbles, to quantum computations, there are fascinating things going on in the world everywhere we look. Computer Graphics is a new medium in several ways. One of the most exciting of its new abilities is that computer-based artistic tools allow us to turn back time and split the universe. ... I find this ability to save every version of my images and programs, and turn back time on a whim, has completely changed how I think about making images and inventing algorithms. Choices are no longer so drastic, so I don't have to fret about whether or not to take a risk. If something seems like a good idea, there's no reason not to pursue it except for the time it takes to try it out. I get to be more playful and intuitive..." Lots more here: http://glassner.com/ http://glassner.com/andrew/cg/graphics.htm ./Jason ______________________________________________ Jason Cunliffe [NOMADICS: Director art+design] Tel/fax: +1 718 422-1078 jasonic@nomadics.org N 43:00.000' W 074:31.875' ALT:1144 ft 84 Henry Street #3C Brooklyn NY 11201 USA From Jason Cunliffe" Radio emerges from the electronic soup Message-ID: <000501c255d6$ec637ae0$6501a8c0@vaio> http://www.newscientist.com/news/news.jsp?id=ns99992732 "A self-organising electronic circuit has stunned engineers by turning itself into a radio receiver. This accidental reinvention of the radio followed an experiment to see if an automated design process, that uses an evolutionary computer program, could be used to "breed" an electronic circuit called an oscillator..." From johnharvey@earthlink.net Sat Sep 7 05:37:52 2002 From: johnharvey@earthlink.net (John Harvey) Date: Fri, 06 Sep 2002 21:37:52 -0700 Subject: [Edu-sig] (no subject) Message-ID: <5.1.1.6.0.20020906213554.01984078@pop.earthlink.net> Group, There are only 10 types of people in the world: Those who understand binary and those who don't. I couldn't resist sharing this. :-( John From rmangaliag@mbox.slu.edu.ph Sat Sep 7 06:59:51 2002 From: rmangaliag@mbox.slu.edu.ph (Ronald Mangaliag) Date: Sat, 07 Sep 2002 13:59:51 +0800 (PHT) Subject: [Edu-sig] java vs. python.... Message-ID: <1031378391.3d7995d797a33@mbox> i dont really know if this is the proper forum... but forgive me for this question... security wise, which one is better... java or python??? ------------------------------------------------------------ ronald ali l. mangaliag computer applications department saint louis university 2600 baguio city, philippines ------------------------------------------------------------ ------------------------------------------------ E-mail service provided by SLUNET Saint Louis University ( http://www.slu.edu.ph ) ------------------------------------------------ From urnerk@qwest.net Sat Sep 7 08:12:21 2002 From: urnerk@qwest.net (Kirby Urner) Date: Sat, 07 Sep 2002 00:12:21 -0700 Subject: [Edu-sig] java vs. python.... In-Reply-To: <1031378391.3d7995d797a33@mbox> Message-ID: <5.1.1.6.0.20020906235805.0270eb10@pop.ptld.qwest.net> At 01:59 PM 9/7/2002 +0800, Ronald Mangaliag wrote: >i dont really know if this is the proper forum... but forgive me for this >question... > >security wise, which one is better... java or python??? Depends in part what you mean by security. Some kinds of security are more the responsibility of the operating system kernel than the responsibility of any particular process designed for user space. Certainly Java has lots more built in security classes, inherited by the Applet class and so on. It was designed from the ground up to allow clients to safely download and run code over the internet. One shouldn't be lulled into complacency though: standalone Java programs have as much power to be malicious as any. That's where a certification authority comes in: you want to know where a program came from, and whether to trust this source, before you give it the OK to run on your CPU. But maybe that's not what you meant be security. If you're running your programs on the server side, then Python may be the way to go. Python is often used in-house, where employees mostly trust one another not to be malicious. If you mangle class methods or properties to make them private, it's more to make the code readable/understandable, than it is to frustrate some would-be cracker. Kirby From rmangaliag@mbox.slu.edu.ph Sat Sep 7 10:04:40 2002 From: rmangaliag@mbox.slu.edu.ph (Ronald Mangaliag) Date: Sat, 07 Sep 2002 17:04:40 +0800 (PHT) Subject: [Edu-sig] java vs. python.... In-Reply-To: <5.1.1.6.0.20020906235805.0270eb10@pop.ptld.qwest.net> References: <5.1.1.6.0.20020906235805.0270eb10@pop.ptld.qwest.net> Message-ID: <1031389480.3d79c1281b203@mbox> thanks kirby.... i'm in the process of making a simple database project to be run in a local server... no one uses python here... i guess, i'm the only one... :) i would like to have some "bullets" or facts to convince them to use python on the server side instead of java servlets... our main concern right now is the security of python in a networked environment... i am new to python and certainly new to java... what could be my guidelines so that at least i can convince them to use python... though i'm a certified pythoniac... i really need resources to convince my colleagues... thanks in advance... Quoting Kirby Urner : > At 01:59 PM 9/7/2002 +0800, Ronald Mangaliag wrote: > >i dont really know if this is the proper forum... but forgive me for > this > >question... > > > >security wise, which one is better... java or python??? > > Depends in part what you mean by security. Some kinds of security > are more the responsibility of the operating system kernel than > the responsibility of any particular process designed for user > space. > > Certainly Java has lots more built in security classes, inherited > by the Applet class and so on. It was designed from the ground up > to allow clients to safely download and run code over the internet. > > One shouldn't be lulled into complacency though: standalone Java > programs have as much power to be malicious as any. That's where > a certification authority comes in: you want to know where a > program came from, and whether to trust this source, before you > give it the OK to run on your CPU. > > But maybe that's not what you meant be security. > > If you're running your programs on the server side, then Python > may be the way to go. > > Python is often used in-house, where employees mostly trust one > another not to be malicious. If you mangle class methods or > properties to make them private, it's more to make the code > readable/understandable, than it is to frustrate some would-be > cracker. > > Kirby > > > ------------------------------------------------------------ ronald ali l. mangaliag computer applications department saint louis university 2600 baguio city, philippines ------------------------------------------------------------ ------------------------------------------------ E-mail service provided by SLUNET Saint Louis University ( http://www.slu.edu.ph ) ------------------------------------------------ From Jason Cunliffe" <1031389480.3d79c1281b203@mbox> Message-ID: <002501c25657$2dc628e0$6501a8c0@vaio> > what could be my guidelines so that at least i can convince them to use > python... though i'm a certified pythoniac... i really need resources to > convince my colleagues... http://www.python.org/Quotes.html Jython http://www.jython.org/ http://www.onjava.com/pub/a/onjava/2002/03/27/jython.html http://www.onlamp.com/pub/a/python/2002/04/11/jythontips.html http://www.oreilly.com/catalog/jythoness/ http://www.ssec.wisc.edu/~billh/visad.html Comparing Python to Other Languages [Guido van Rossum] http://python.org/doc/essays/comparisons.html Python vs. Java http://trident.mcs.kent.edu/~arvind/graduate-reports/jzhu.html A subjective analysis of two high-level, object-oriented languages Comparing Python to Java http://www.python-eggs.org/links.html Thinking in Python http://www.mindview.net/Books/Python/ThinkingInPython.html Python 9: Interview with Bruce Eckel After mastering the complexities of C++ and Java -and making them easy to grasp for thousands of programmers- Bruce Eckel has moved on to Python. He describes the language and its strengths in light of his experience with other languages and tools. Dr. Dobbs Technetcast [RealVideo stream] http://technetcast.ddj.com/tnc_play.ram?mode=compact&stream_id=466&stream_type=5 &clip_start=&clip_end=&style= Zope http://www.zope.org/ Resources http://www.vex.net/parnassus/ http://py.vaults.ca/~x/parnassus/apyllo.py/126307487 More Resources [links on a single page] http://www.python-eggs.org/links.html eGenix.com mx BASE Package: http://www.egenix.com/files/python/index.html Why I Promote Python by Paul Prescod http://www.oreilly.com/news/prescod_0300.html Google's Gaffe by Paul Prescod April 24, 2002 Extended discussion "...Later I will show a way to declare the types strongly and statically enough to satisfy the most ardent Java or C# masochist" http://www.xml.com/pub/a/2002/04/24/google.html hth ./Jason From Jason Cunliffe" <1031389480.3d79c1281b203@mbox> <002501c25657$2dc628e0$6501a8c0@vaio> Message-ID: <004401c25690$64b8b0a0$6501a8c0@vaio> > A subjective analysis of two high-level, object-oriented languages > Comparing Python to Java > http://www.python-eggs.org/links.html oops: cut'n'paste error there here is the correct url: A subjective analysis of two high-level, object-oriented languages Comparing Python to Java http://twistedmatrix.com/users/glyph/rant/python-vs-java.html Also you may want to read about the brilliant 'Twisted Matrix' framework and discuss it with your colleagues. It may be overkill for your current application, but it's very powerful and flexible. And a great testimony to Python's charms and capability in network applications. Written by people who worked with Zope [zope.org], and then graduated to develop something more open, with deeper interoperability ;-) This is one of the points stressed by Bruce Eckel in the Dr. Dobb's 2001 interview. http://technetcast.ddj.com/tnc_play.ram?mode=compact&stream_id=466&stream_type=5 &clip_start=&clip_end=&style= Python has rich landscape of contributed modules and frameworks. It does not demand you stay rigidly with any particular solution domain. With Python your are always free to engage other languages, components and toolkits according to your need, skill, and style. This is important when there is a mixed development team with preferred or legacy code to absorb and extend. Python has a rich ,loving family: It is supported by one of the best openSource, on-line communities anywhere. High signal-to-noise, smart and generous. And its growing... comp.lang.python http://starship.python.net/~just/comp.lang.python/ 'Twisted Matrix' - A Development Tool Twisted is a framework, written in Python, for writing networked applications. It includes implementations of a number of commonly used network services such as a web server, an IRC chat server, a mail server, a relational database interface and an object broker. Developers can build applications using all of these services as well as custom services that they write themselves. Twisted also includes a user authentication system that controls access to services and provides services with user context information to implement their own security models. Twisted provides important features needed for networking programming, both at the high and low levels: Pluggable event loops allowing the developer to take advantage of platform-specific capabilities. Abstractions of protocols and transports. Through Twisted Spread, mechanisms for network encoding of data (in Python, Java, ELisp, and other languages), to a full-blown distributed object system. ./Jason From Jason Cunliffe" <1031389480.3d79c1281b203@mbox> Message-ID: <006201c25694$4b9faf20$6501a8c0@vaio> Python Server Pages There are many Python Server Pages toolkits to choose from. 'Spyce' is one of them... It's new and looks very nice. The site is helpful and very clear. So even if you don't use Spyce, but are consdering Python Server pages, it would time well spent. Includes short focused comparisons with other langauge offerings. [ =>> bullet points] http://spyce.sourceforge.net/ "SPYCE is a webserver plugin that supports simple and efficient Python-based dynamic HTML scripting. Those who like Python and are familiar with JSP, or PHP, or ASP, should have a look at this engine. It allows one to generate dynamic HTML content just as easily, using Python for the dynamic parts. Its modular design makes it very flexible and extensible. It supports FastCGI, CGI and mod_python to plugin into Apache and most other webservers. It can also be used as a command-line utility for HTML pre-processing or as a web server proxy. The easiest way to understand what Spyce can do is just to look through the examples in the documentation." http://spyce.sourceforge.net/doc_eg.html ... "Java Server Pages, JSP, is a widely popular, effective and well-supported solution based on Java Servlet technology. Spyce differs from JSP in that it embeds Python code among the HTML, thus providing two advantages over Java. First, Python is a high-level scripting language, where rapid manipulation of text is more readily performed. Second, Python is interpreted and dynamically-typed, which can be advantageous for rapid prototyping. Like Java, Python is portable." ... Performance "Although flexibility usually outweighs raw performance in the choice of technology, it is nice to know that the technology that you have chosen is not a resource hog, and can scale to large production sites. The current Spyce implementation is comparable to its cousin technologies: JSP, PHP and ASP." http://spyce.sourceforge.net/doc_perf.html ./Jason From Jason Cunliffe" was {Re: [Edu-sig] java vs. python....} References: <5.1.1.6.0.20020906235805.0270eb10@pop.ptld.qwest.net> <1031389480.3d79c1281b203@mbox> <002501c25657$2dc628e0$6501a8c0@vaio> Message-ID: <006801c25696$bf48d620$6501a8c0@vaio> I have recently been exploring the wonders of file upload via HTTP using enctype="multipart/form-data". Spyce has the *sweetest* solution yet: -- "fileupload.spy"-- [[\ if request.post('ct'): response.setContentType(request.post1('ct')) response.write(request.file('upfile').value) raise spyce.spyceDone ]] Upload a file and it will be sent back to you.
[[-- input forms --]]
file:
content-type:
That's all folks! ./Jason From Jason Cunliffe" Python for Journalists and Couch Poatatoes? Message-ID: <00dc01c256a5$20530720$6501a8c0@vaio> "The only decision that's been taken at this stage is that inaction is not an option" -- Tony Blair Anyone care to translating that in Python? When I was at school, we had lots of parsing exercises, in both English class and then Latin. Sometimes torture, sometimes fun, depending on the teacher, the content and our ability to use it. I hope that as computational literacy works it way into the hearts and minds of schools everywhere [optimistic inevitability], there will be great value in developing descriptive algorithms, such as parsing [literature] texts. - To understand points of literature, grammar, content, structure - To teach and develop programming skills. It would require teachers who are really fluent and adept in a language such as Python. Just as Kirby and others have been developing their math-oriented Python curriculum, what do you think the potential is for programming natural language and literature for fun. I may be crazy, but just imagine... Python for Journalists - In this class we take newspaper and TV news and [try to] translate them into Python. Python's Fables - Aesop's Fables Python for Lawyers - Standard contracts as Python scripts [employment contract, loans, rental leases, and of course licenses] Python for Historians - take an episode/chapter of history and translate Python for Travelers - Directions for making journeys [home->school->back, a holiday] Python for Cooks - from cookies to wedding banquets, you get the idea Python for Poets - How would you express the style, quality, form and message of poems and poets? [Shakespeare sonnet, Rumi, T.S.Eliot, ... ] Python for Singers - as above but breaking down popular songs.. Several layers to this: song structure, style and lyric. Singer style, Musical arrangement. Music Video structure... Python for Couch Potatoes 1. - 24hrs of TV programming -> start with TV Guide http://www.tvguide.com/listings/ 2. - then pick any program or genre of program [soaps, sitcom, TV news {how DO they manage to all broadcast the same story at almost the same moment?}, reality TV, game show, dating shows, Police Drama, Talk show, and ... advertising] I am sure you can imagine myriad problems with this as well, as many more fun and inspiring possibilities. ./Jason From fred@ontosys.com Sat Sep 7 21:24:13 2002 From: fred@ontosys.com (fred@ontosys.com) Date: Sat, 7 Sep 2002 15:24:13 -0500 Subject: [Edu-sig] CP4E: Programming for Fun => Python for Journalists and Couch Poatatoes? In-Reply-To: <00dc01c256a5$20530720$6501a8c0@vaio> References: <00dc01c256a5$20530720$6501a8c0@vaio> Message-ID: <20020907202413.GA9254@ontosoft.com> On Sat, Sep 07, 2002 at 03:31:12PM -0400, Jason Cunliffe wrote: > Just as Kirby and others have been developing their math-oriented Python > curriculum, what do you think the potential is for programming natural language > and literature for fun. > I may be crazy, but just imagine... > > Python for Journalists > - In this class we take newspaper and TV news and [try to] translate them into > Python. I don't know about translating into Python, but I'd love to have an application that would parse arbitrary English sentences and produce a corresponding sentence diagram. Another interesting possibility is to translate English text into Contextual Graphs (per Sowa). What is the (noncommercial) state of the art in automated parsing of natural language text? Is a project like this feasible, or does it need a Cyc-like knowledge base to disambiguate words based on context? -- Fred Yankowski fred@ontosys.com tel: +1.630.879.1312 OntoSys, Inc PGP keyID: 7B449345 fax: +1.630.879.1370 www.ontosys.com 38W242 Deerpath Rd, Batavia, IL 60510-9461, USA From Jason Cunliffe" Python for Journalists and Couch Poatatoes? References: <00dc01c256a5$20530720$6501a8c0@vaio> <20020907202413.GA9254@ontosoft.com> Message-ID: <000d01c256bb$bc8fa9c0$6501a8c0@vaio> > What is the (noncommercial) state of the art in automated parsing of > natural language text? Is a project like this feasible, or does it > need a Cyc-like knowledge base to disambiguate words based on context? Hi Fred Here are some I am aware of. There's LOTS more including Java toolkits which can be used with Jython, and all the cool stuff on the edges of sequencing and visualization work. BioIT is generating all sorts of tools which can be used for other disciplines. POVTalk, which is a Natural Language based 3D scene generator http://homepages.ihug.co.nz/~synopsis/computing/ Proposal: A Natural Language Programming Toolkit for Python Edward Loper, Steven Bird July 6, 2002 http://nltk.sourceforge.net/tech/proposal.pdf The NL Toolkit (NLTK) is a Python package intended to simplify the task of programming natural language processing systems. Its primary audience is graduate and undergraduate students studying computational linguistics http://nltk.sourceforge.net/ PyWordNet is a Python interface to the WordNet database of word meanings and lexical relationships. (A lexical relationship is a relationship between words, such as synonym, antonym, hypernym ("poodle" -> "dog"), and hyponym ("poodle" -> "dog"). http://pywordnet.sourceforge.net/ ./Jason From Jason Cunliffe" TEN - Master Site - Editorial Message-ID: <000501c256bc$3e012ce0$6501a8c0@vaio> Internet Learning Centers in Laos http://www.techempower.net/0/Editorial.asp?this_cat=Projects&obj_id=686&aff_id=0 "The project wants to wire the country, one school at a time. It is building internet learning centers to help the people maintain their traditional way of life, using the Internet to improve their economic return from diversified, organic agriculture and hand made silk textiles ... Jhai would like to tighten up the educational component of the internet learning centers, cut costs without cutting quality and document what they are doing better so it can be shared. They would like to network better with successful projects in other parts of the world and, like most projects, they need help *finding* money and time from people who have been successful in the computer business, but still have the original concern for democratizing information and knowledge. People we work with in the coffee area NEVER went to school, yet are incredibly bright. How do we hop,skip and jump with them into computer useage without ruining their culture which largely works and which they love?" Contact: Jhai Foundation PO Box 6269 Vientiane Laos Email: leethorn@jhai.org & Vorasone@hotmail.com Telephone: 1-415-334-2100 856-20-521037 Facsimile: 1-415-334-210 From Jason Cunliffe" <20020907202413.GA9254@ontosoft.com> <000d01c256bb$bc8fa9c0$6501a8c0@vaio> <3D7ABD0C.9C792F19@anansispaceworks.com> Message-ID: <001901c256ea$4d55cd80$6501a8c0@vaio> Teryy, For Python a great place to start is 'Snack'. http://www.speech.kth.se/snack/ "The Snack Sound Toolkit is designed to be used with a scripting language such as Tcl/Tk or Python. Using Snack you can create powerful multi-platform audio applications with just a few lines of code. Snack has commands for basic sound handling, e.g. sound card and disk I/O. Snack also has primitives for sound visualization, e.g. waveforms and spectrograms. It was developed mainly to handle digital recordings of speech, but is just as useful for general audio. Snack has also successfully been applied to other one-dimensional signals. The combination of Snack and a scripting language makes it possible to create sound tools and applications with a minimum of effort. This is due to the rapid development nature of scripting languages. As a bonus you get an application that is cross-platform from start. It is also easy to integrate Snack based applications with existing sound analysis software." Python Snack manual, version 2.2 http://www.speech.kth.se/snack/man/snack2.2/python-man.html Spectograms are crucial to understanding speech and the role of formants. Be sure to followup on the Snack links page: http://www.speech.kth.se/snack/links.html For example, a paper on the use of Snack was presented at the ICSLP '98 conference. [ICSLP = International Conference on Spoken Language Processing] http://www.speech.kth.se/~jocke/publications/icslp98_web.html Two other important toolkits I recommend to help you do what you want are: PD = Pure Data and its GEM extensions http://www.pure-data.org/ http://www.crca.ucsd.edu/~msp/Pd_documentation/index.htm PD has terrific community [andmailing list] doing all manner of experimental sound work, much of for live performance orientation. The GEM extensions may well cover your graphic needs too. http://www.danks.org/mark/ JSyn - Audio Software Synthesis API and Plugins for Java [works with Jython] http://www.softsynth.com/jsyn/ Other interactive synthesis tools I suggest for deepening ones grasp of speech and speech-like sound are: RGS - Realtime Granular Synthesis by Henry Lowengard http://www.echonyc.com/~jhhl/software.html RGS was developed for Amiga. To the best of my knowldege it will still run on a number of computer platforms using UAE [Universal Amiga Emulator]. A modern Windows version I have used is 'Coagula' by Rasmus Ekman: http://hem.passagen.se/rasmuse/Coagula.htm Finally, an unusual book with a novel, eye-openig approach to speech analysis is "Who is Fourier?" http://www.lexlrf.org/pub/fourier.html http://www.amazon.com/exec/obidos/ASIN/0964350408/104-1198719-6481569 Developed by the 'Transnational College of Lex', the book is an extraordinary and lively introduction to calculus, working with the idea recorded vocal sounds and leading up to fourier transformations to compare and graph patterns of Japanese vowwls. The result on page 160 is stunning. Clearly their technique can be applied to other languages and sounds. hth & please keep me posted about your project best wishes ./Jason From mustard1@optonline.net Sun Sep 8 17:18:59 2002 From: mustard1@optonline.net (Eric S.) Date: Sun, 08 Sep 2002 12:18:59 -0400 Subject: [Edu-sig] python lessons Message-ID: <002401c25753$700e90a0$d8a52e18@computername> This is a multi-part message in MIME format. --Boundary_(ID_zuP+LwiI+Zci1mndwUVqHA) Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT i was wonderin if you know of any python lessons for my age. I'm 15 years old and I live in Westchester NY thanks, Eric --Boundary_(ID_zuP+LwiI+Zci1mndwUVqHA) Content-type: text/html; charset=iso-8859-1 Content-transfer-encoding: 7BIT
i was wonderin if you know of any python lessons for my age. I'm 15 years old and I live in Westchester NY
 
thanks,
Eric
--Boundary_(ID_zuP+LwiI+Zci1mndwUVqHA)-- From glingl@aon.at Sun Sep 8 17:43:41 2002 From: glingl@aon.at (Gregor Lingl) Date: Sun, 08 Sep 2002 18:43:41 +0200 Subject: [Edu-sig] python lessons References: <002401c25753$700e90a0$d8a52e18@computername> Message-ID: <3D7B7E3D.5050603@aon.at> Eric S. schrieb: > i was wonderin if you know of any python lessons for my age. I'm 15 > years old and I live in Westchester NY > > thanks, > Eric Have a look at http://www.livewires.org.uk/python/ Gregor From Jason Cunliffe" Message-ID: <006601c25771$352a97e0$6501a8c0@vaio> > i was wonderin if you know of any python lessons for my age. I'm 15 years old and I live in Westchester NY Hi Eric Q1. Are you looking live classes or tutors? Q2 ..Or are you looking for self-teaching course material, such as book+CD +web + video? Q3: What is your level? Are you a beginner? Have you done any programming, if so what ? There is very clear book+CD series on programming by Deitel. They publish one dedicated to Python: Although not intended for business, I think the series might also be suitable for you. For a single book for self-teaching Python for beginners, I don't think you can do any better. Deitel have a multimedia CD course now for Python. Perhaps that is what you are looking for.. See the Python books right at the bottom of the page http://deitel.com/books/index.html You can download sample chapters Python How to Program (With CD-ROM) by Harvey M. Deitel, Paul J. Deitel, B. A. Wiedermann, Jonathan P. Liperi ISBN: 0130923613 [published 2002] or from Amazon http://www.amazon.com/exec/obidos/tg/detail/-/0130923613/104-1198719-6481569 ..and here is the new multimedia CD course based on that book: The Complete Python Training Course ISBN: 013063765 [published 2002] Includes Python How to Program and the Python Multimedia Cyber Classroom (interactive CD ROM) http://vig.prenhall.com/catalog/academic/product/1,4096,0130673757,00.html The Deitel books seem very expensive, but are much better value than most computer books. They are very well written, with very clear steps to build skills and understanding. There are other excellent Python books. But the Deitel series is unique because the writers run a full time training business. They know how to pace topics and structure the material for classroom. That means good notes throughout, short description of key points and principles, end of chapter summary, exercises [with answers]. All Python examples are color highlighted which makes it much easier to follow the code. The books are tightly structured with many numbered sub-sections, supported by a strong index at the back to help find things. I don't have the Deitel Python book, but I have another one in the same series titled: "Internet & World Wide Web: How to Program". Besides covering a huge amount, it starts with the absolute basics, and never assumes one knows anything. But it never talks down and moves along very quickly. I also like it because it introduces several languages and offers parallel examples in them: Python, Perl, PHP, JavaScript, ASP, Java. Great use of color: illustrations [diagrams, screenshots] and color type thoughout. Recommended. hope this helps good luck ./Jason From rmangaliag@mbox.slu.edu.ph Mon Sep 9 06:53:18 2002 From: rmangaliag@mbox.slu.edu.ph (Ronald Mangaliag) Date: Mon, 09 Sep 2002 13:53:18 +0800 (PHT) Subject: [Edu-sig] java vs. python.... In-Reply-To: <006201c25694$4b9faf20$6501a8c0@vaio> References: <5.1.1.6.0.20020906235805.0270eb10@pop.ptld.qwest.net> <1031389480.3d79c1281b203@mbox> <006201c25694$4b9faf20$6501a8c0@vaio> Message-ID: <1031550798.3d7c374e8de34@mbox.slu.edu.ph> thank you very much for your help... Quoting Jason Cunliffe : > Python Server Pages > > There are many Python Server Pages toolkits to choose from. 'Spyce' is > one of > them... > It's new and looks very nice. The site is helpful and very clear. So > even if you > don't use Spyce, but are consdering Python Server pages, it would time > well > spent. Includes short focused comparisons with other langauge offerings. > [ =>> > bullet points] > > http://spyce.sourceforge.net/ > > "SPYCE is a webserver plugin that supports simple and efficient > Python-based > dynamic HTML scripting. Those who like Python and are familiar with JSP, > or PHP, > or ASP, should have a look at this engine. It allows one to generate > dynamic > HTML content just as easily, using Python for the dynamic parts. Its > modular > design makes it very flexible and extensible. It supports FastCGI, CGI > and > mod_python to plugin into Apache and most other webservers. It can also > be used > as a command-line utility for HTML pre-processing or as a web server > proxy. The > easiest way to understand what Spyce can do is just to look through the > examples > in the documentation." > > http://spyce.sourceforge.net/doc_eg.html > ... > > "Java Server Pages, JSP, is a widely popular, effective and > well-supported > solution based on Java Servlet technology. Spyce differs from JSP in > that it > embeds Python code among the HTML, thus providing two advantages over > Java. > First, Python is a high-level scripting language, where rapid > manipulation of > text is more readily performed. Second, Python is interpreted and > dynamically-typed, which can be advantageous for rapid prototyping. Like > Java, > Python is portable." > > ... > Performance > "Although flexibility usually outweighs raw performance in the choice of > technology, it is nice to know that the technology that you have chosen > is not a > resource hog, and can scale to large production sites. The current Spyce > implementation is comparable to its cousin technologies: JSP, PHP and > ASP." > http://spyce.sourceforge.net/doc_perf.html > > ./Jason > > > > > _______________________________________________ > Edu-sig mailing list > Edu-sig@python.org > http://mail.python.org/mailman/listinfo/edu-sig > ------------------------------------------------------------ ronald ali l. mangaliag computer applications department saint louis university 2600 baguio city, philippines ------------------------------------------------------------ ------------------------------------------------ E-mail service provided by SLUNET Saint Louis University ( http://www.slu.edu.ph ) ------------------------------------------------ From rmangaliag@mbox.slu.edu.ph Mon Sep 9 08:30:54 2002 From: rmangaliag@mbox.slu.edu.ph (Ronald Mangaliag) Date: Mon, 09 Sep 2002 15:30:54 +0800 (PHT) Subject: [Edu-sig] database for a small network In-Reply-To: <1031550798.3d7c374e8de34@mbox.slu.edu.ph> References: <5.1.1.6.0.20020906235805.0270eb10@pop.ptld.qwest.net> <1031389480.3d79c1281b203@mbox> <006201c25694$4b9faf20$6501a8c0@vaio> <1031550798.3d7c374e8de34@mbox.slu.edu.ph> Message-ID: <1031556654.3d7c4e2e3d4e5@mbox> hi.... it's me again... i would like to create a small database to record all my students' profiles and and the current subject that they are enrolled in... now, i would like to create an interface for my students to upload their projects to a common place using the web (http possibly)... how will i go about the project??? what is the best server that i can use??? what database will i use (access, gadfly, etc)??? other things things that you think is necessary??? ------------------------------------------------ E-mail service provided by SLUNET Saint Louis University ( http://www.slu.edu.ph ) ------------------------------------------------ From Jason Cunliffe" <1031389480.3d79c1281b203@mbox> <006201c25694$4b9faf20$6501a8c0@vaio> <1031550798.3d7c374e8de34@mbox.slu.edu.ph> <1031556654.3d7c4e2e3d4e5@mbox> Message-ID: <013d01c257f6$91422e00$6501a8c0@vaio> I think you should definitely look into Zope http://zope.org Jeff Elkner is using it I believe at Yorktown High School. Python Bibliotheca "The school fell in love with Zope as tool for building websites." http://www.ibiblio.org/obp/pyBiblio/schools.php > i would like to create a small database to record all my students' profiles and > and the current subject that they are enrolled in... Zope includes a persistent object-database and a server which publishes the database adn its methods to the web via a standard URL. All or parts of the ZODB [Zope Object DataBase] can be imported and exported as a single binary file. This same file works across operating systems. There are a number of other database components you can select depending on need. Also write your own and access any Python module. I had good resutsl using BerkelyDB on project. It's fast and a good fit to Python because of its dictionary design. The ZODB has been spun off from Zope for general Python use also, and well documented by Andrew Kuchling and others: http://www.zope.org/Documentation/Articles/ZODB1 http://www.zope.org/Products/StandaloneZODB > now, i would like to create an interface for my students to upload their > projects to a common place using the web (http possibly)... Zope let's you manage onctent with powerful permissions hierrchy. That includes upload via standard HTTP forms or with FTP. FTP puts you directly into the object database and is faster. The defautl Zope system is all done through the web. A wonderful complementary tool is Jerome Alet's ZShell which gives one simple Unix type shell access to managing Zope. I think it may be Zope's best kept secret. Don't leave home without it: http://www.librelogiciel.com/software/ZShell/action_Presentation > how will i go about the project??? > what is the best server that i can use??? > what database will i use (access, gadfly, etc)??? > other things things that you think is necessary??? Zope is rich and complex, and growing. But you can do a tremendous amount straight out the box without end for any custom development. It has many components you can chose from. And an intense on-line community using and developing it. Each with their own wikis and mailing lists. Some people consider Zope overkill, or just don't feel right with it. It's free, openSource, cross platform, and installs very quickly on any machine. So it won't take you long to go for test drive and decide for yourself. There are several books out and many on-line docs and tutorials. An embarrassment of riches, like most of the Python world. ./Jason From Jason Cunliffe" <1031389480.3d79c1281b203@mbox> <006201c25694$4b9faf20$6501a8c0@vaio> <1031550798.3d7c374e8de34@mbox.slu.edu.ph> <1031556654.3d7c4e2e3d4e5@mbox> Message-ID: <014a01c257f8$0198eb20$6501a8c0@vaio> Zope at YorkTown http://linus.yorktown.arlington.k12.va.us/CS/ From jeff@elkner.net Mon Sep 9 13:09:25 2002 From: jeff@elkner.net (Jeffrey Elkner) Date: 09 Sep 2002 08:09:25 -0400 Subject: [Edu-sig] database for a small network In-Reply-To: <013d01c257f6$91422e00$6501a8c0@vaio> References: <5.1.1.6.0.20020906235805.0270eb10@pop.ptld.qwest.net> <1031389480.3d79c1281b203@mbox> <006201c25694$4b9faf20$6501a8c0@vaio> <1031550798.3d7c374e8de34@mbox.slu.edu.ph> <1031556654.3d7c4e2e3d4e5@mbox> <013d01c257f6$91422e00$6501a8c0@vaio> Message-ID: <1031573365.14369.4.camel@mdeicaza> Zope definitely rocks! I am using it not only at school, but for a number of community organization websites that I've helped set up. This year I plan to run a "paperless classroom", so the first thing that students are learning is how to use their Zope accounts. jeff elkner yorktown high school arlington, va On Mon, 2002-09-09 at 07:46, Jason Cunliffe wrote: > I think you should definitely look into Zope > http://zope.org > > Jeff Elkner is using it I believe at Yorktown High School. > > Python Bibliotheca > "The school fell in love with Zope as tool for building websites." > http://www.ibiblio.org/obp/pyBiblio/schools.php > > > i would like to create a small database to record all my students' profiles > and > > and the current subject that they are enrolled in... > > Zope includes a persistent object-database and a server which publishes the > database adn its methods to the web via a standard URL. All or parts of the ZODB > [Zope Object DataBase] can be imported and exported as a single binary file. > This same file works across operating systems. > There are a number of other database components you can select depending on > need. Also write your own and access any Python module. I had good resutsl using > BerkelyDB on project. It's fast and a good fit to Python because of its > dictionary design. > The ZODB has been spun off from Zope for general Python use also, and well > documented by Andrew Kuchling and others: > http://www.zope.org/Documentation/Articles/ZODB1 > http://www.zope.org/Products/StandaloneZODB > > > now, i would like to create an interface for my students to upload their > > projects to a common place using the web (http possibly)... > > Zope let's you manage onctent with powerful permissions hierrchy. That includes > upload via standard HTTP forms or with FTP. FTP puts you directly into the > object database and is faster. > The defautl Zope system is all done through the web. > > A wonderful complementary tool is Jerome Alet's ZShell which gives one simple > Unix type shell access to managing Zope. I think it may be Zope's best kept > secret. Don't leave home without it: > http://www.librelogiciel.com/software/ZShell/action_Presentation > > > how will i go about the project??? > > what is the best server that i can use??? > > what database will i use (access, gadfly, etc)??? > > other things things that you think is necessary??? > > Zope is rich and complex, and growing. But you can do a tremendous amount > straight out the box without end for any custom development. It has many > components you can chose from. And an intense on-line community using and > developing it. Each with their own wikis and mailing lists. Some people consider > Zope overkill, or just don't feel right with it. It's free, openSource, cross > platform, and installs very quickly on any machine. So it won't take you long to > go for test drive and decide for yourself. There are several books out and many > on-line docs and tutorials. An embarrassment of riches, like most of the Python > world. > > ./Jason > > > > _______________________________________________ > Edu-sig mailing list > Edu-sig@python.org > http://mail.python.org/mailman/listinfo/edu-sig > From Jason Cunliffe" <1031389480.3d79c1281b203@mbox> <006201c25694$4b9faf20$6501a8c0@vaio><1031550798.3d7c374e8de34@mbox.slu.edu.ph> <1031556654.3d7c4e2e3d4e5@mbox> <013d01c257f6$91422e00$6501a8c0@vaio> <1031573365.14369.4.camel@mdeicaza> Message-ID: <002801c25810$ae6b8c00$6501a8c0@vaio> > Zope definitely rocks! I am using it not only at school, but for a > number of community organization websites that I've helped set up. Zope not only rocks but it is quite addictive. I am a recovering Zopaholic ;-) > This year I plan to run a "paperless classroom", so the first thing that > students are learning is how to use their Zope accounts. Sounds interesting. Please keep us posted and good luck ./Jason From p.kent@mail.com Thu Sep 12 16:46:33 2002 From: p.kent@mail.com (Phillip Kent) Date: Thu, 12 Sep 2002 16:46:33 +0100 Subject: [Edu-sig] CP4E: Programming for Fun => Python for Journalists and Couch Poatatoes? In-Reply-To: <00dc01c256a5$20530720$6501a8c0@vaio> Message-ID: <5.1.0.14.2.20020912163855.00a62180@pop1.mail.com> At 03:31 PM 9/7/02 -0400, "Jason Cunliffe" wrote: >"The only decision that's been taken at this stage is that inaction is not an >option" > -- Tony Blair > >Anyone care to translating that in Python? > >When I was at school, we had lots of parsing exercises, in both English class >and then Latin. Sometimes torture, sometimes fun, depending on the >teacher, the >content and our ability to use it. > >I hope that as computational literacy works it way into the hearts and >minds of >schools everywhere [optimistic inevitability], there will be great value in >developing descriptive algorithms, such as parsing [literature] texts. >- To understand points of literature, grammar, content, structure >- To teach and develop programming skills. > >It would require teachers who are really fluent and adept in a language >such as >Python. Just as Kirby and others have been developing their math-oriented >Python >curriculum, what do you think the potential is for programming natural >language >and literature for fun. >I may be crazy, but just imagine... > >Python for Journalists >- In this class we take newspaper and TV news and [try to] translate them into >Python. >........................... Sounds good to me! There is some precedent for this that I know of: "Exploring Language with Logo", Goldenberg and Feurzeig, MIT Press 1987. I never used the book for teaching anybody, but I think it has some very nice ideas (also in the structure of the text, which the authors call "multiple voices" as a way of guiding the student in different ways at different times), and the code should translate very easily into Python. I think it's also the case that some school classes in English (in the UK at least) are using commercial textual analysis software. - Phillip ++++++ Dr Phillip Kent, London, UK mathematics education technology research p.kent@mail.com mobile: 07950 952034 ++++++ From ajs@ix.netcom.com Sun Sep 15 20:43:30 2002 From: ajs@ix.netcom.com (Arthur) Date: Sun, 15 Sep 2002 15:43:30 -0400 Subject: [Edu-sig] [Update] re: Does edu-sig extend to Jython Message-ID: <000001c25cf0$7a2a1580$9865fea9@arthur> Thought I'd share an update on my efforts to solve what I had termed a "method loading" issue in trying to achieve the scripting interface I had envisioned for PyGeo. The discussion is in the August edu-sig archive. I had written - >And in doing some real error catching and reporting on arguments, >I would expect isinstance will come into play, and in >doing it, it should not be very much additional burden to >do it in such a way so that at least I can make argument >order irrelevant. >After that I guess I need to see where I am, and then take the more >complex issues of this kind on a case by case basis - there >probably is no one-size answer for all cases. Turns out "issubclass", rather than "issinstance", was the key to accomplishing what I wanted. And I was able to accomplish everything I had hoped - methods called based on passed arguments (order insensitive), error reporting of invalid argument sets,etc. - with a ten line function. The function is currently, BTW, ugly and broken - but basically funtional. I will get it refined in due course. Using this, and the occasional string qualifier, there are in the end going to be maybe 15 "argument smart" classes with which the user interacts, rather the 40 to 50 there had been. Another BTW: I also wanted to be lenient in terms of the passing of string qualifiers. "CircumCenter", "Cirumcenter", "Circum_Center", "Circum_center" all acceptable.Was simple to implement. So whether I have made the right choices for my Scripting Interfacte remains to be seen. But in the end Python posed no limitation on allowing me to implement exactly what I envisioned, in all essential respects. Also satisfying that I have been able to implement a serviceable (though not perfect) Observer pattern in a few lines of Python. Essentially as classes are instantiated, its arguments, and recursively, the arguments to its argments, are inspected. The class instance is registered to any of these arguments which are accessible for manipulation to the user through the GUI. The result, of course, is that when a point (for example) is interactively picked and moved, only the class instances registered with it need to be updated. Significant performance benefit - depending on the complexity of the construction. In short, having much fun. Art From Jason Cunliffe" Blender Foundation Message-ID: <004101c25cff$c9166860$6501a8c0@vaio> Greetings I have posted here before about 'Blender', a powerful 3D modeling and animation software developed by Ton Roosendaal in Netherlands. Blender had selected Python for its scripting platform, and all sorts of good things were emerging from the combination.. Then the early this summer some really bad news struck - Blender was dead. Sudden victim of the cruel bankruptcy and legal problems of NaN its holding company. The very lively Blender community is mostly European, with strong in Holland and France. And they were shocked but motivated by the news. Even though Blender software had been freely downloadable, it was never open. Perhaps that had something to do with NaN's business problems, but probably not since they were a service company selling 3D animation, not a software vendor. Blender was an evolving by-product of tools the NaN design team used in-house. Then, as only you might expect from the enlightened and pragmatic Dutch, on Friday July 5 came some rare and surprising good news: "New future for Blender as Free Software! Today the shareholders of NaN Holding have reached an agreement on the outlines for a new future for Blender. In general it means that a non-profit organization (the Blender Foundation) will be enabled to execute its plans, including Blender development as an 'open source' or 'free software' project..." Two weeks later on July 18th, an online campaign started to raise the money to buy Blender's freedom so it can continue a new life as GPL openSource project. A month later a progress graph of donations was posted: http://www.blender3d.com/meter_report.html On week ago on Sept 7th, it was announced tada.. $100 [Euro] had been collected, enough to guarantee releasing Blender's source! The Open Blender project rolls forth. You can read more about it, and register for your membership participation if so inclined at: http://www.blender3d.com/ ./Jason ______________________________________________ Jason Cunliffe [NOMADICS: Director art+design] Tel/fax: +1 718 422-1078 jasonic@nomadics.org N 43:00.000' W 074:31.875' ALT:1144 ft 84 Henry Street #3C Brooklyn NY 11201 USA From Jason Cunliffe" Blender Foundation References: <004101c25cff$c9166860$6501a8c0@vaio> Message-ID: <006201c25d09$89791d60$6501a8c0@vaio> > On week ago on Sept 7th, it was announced tada.. $100 [Euro] had been collected, > enough to guarantee releasing Blender's source! ...that should read $100K From Jason Cunliffe" BlenderMeter Message-ID: <000501c25d15$46d5ac60$6501a8c0@vaio> http://www.jol-tech.net/blendermeter/ BlenderMeter is a small Jython Application that will track the status of the Blender Fund. [distributed it as a standalone Application for several platforms] ./Jason From ssgrr2003w@rti7020.etf.bg.ac.yu Mon Sep 16 04:34:32 2002 From: ssgrr2003w@rti7020.etf.bg.ac.yu (ssgrr2003w@rti7020.etf.bg.ac.yu) Date: Mon, 16 Sep 2002 05:34:32 +0200 Subject: [Edu-sig] Invitation to SSGRR conferences in ITALY! Message-ID: <200209160334.g8G3YWL26427@vreme.yubc.net> CALL FOR PAPERS AND PARTICIPATION AT SSGRR CONFERENCES IN YEAR 2003 The SSGRR (Scuola Superiore G Reiss Romoli) Congress Center, Telecom Italia Learning Services, L'Aquila (near Rome), ITALY (www.ssgrr.it). Respected Dr. We are honored to invite you to submit and present your paper(s) at the two SSGRR conferences specified below: INTERNATIONAL CONFERENCES ON ADVANCES IN INFRASTRUCTURE FOR ELECTRONIC BUSINESS, EDUCATION, SCIENCE, MEDICINE, AND MOBILE TECHNOLOGIES ON THE INTERNET WINTER Conference 2003: >From Monday January 6 at 5pm till Sunday January 12 at 10am To submit paper or ask questions: ssgrr2003w@rti7020.etf.bg.ac.yu Keynotes: Lyman (Berkeley), Neuhold (Fraunhofer), Neal (Tufts Medical School), ... SUMMER Conference 2003: >From Monday July 28 at 5pm till Sunday August 3 at 10am To submit paper or ask questions: ssgrr2003s@rti7020.etf.bg.ac.yu Keynotes: Kroto (Nobel Laureate), Patt (IEEE Eckert-Mauchly Laureate), Carlton (US Air Force Surgeon General), ... For details, see IEEE COMPUTER, Aug 2002 (page 33) and the WWW site www.ssgrr.it (written carefully+precisely, with answers to all FAQ). Check with past participants (their names/emails are on the WWW). Most of them believe this is the most interesting, rewarding, and definitely the most hospitable conference they ever attended! Fast professional and peer review in 15 days. Capacity of the SSGRR congress center is 200 participants. The list of participants will be closed after 200 papers accepted. Consequently, SUBMIT YOUR PAPER(S) AS EARLY AS POSSIBLE! ______________________________________________________________________ Location (see WWW for details): SSGRR is the DE-LUX congress and education center of the Telecom Italia Learning Services, located about 60 miles from Rome, near Gran Sasso (the highest Appenini peak), with fast access to the major Appenini ski resorts (in winters, 15 minutes by car), and Adriatic sea beaches (in summers, 45 minutes by car). Keynotes (see WWW for details): A Nobel Laureate was the keynote speaker each year in the past (Jerome Friedman of MIT, Robert Richardson of Cornell, etc...), and the major 2003 keynote is also reserved for a Nobel Laureate (Harry Kroto from United Kingdom). Other 2003 keynote speakers are Yale Patt from UofTexas@Austin (an IEEE Eckert-Mauchly Laureate), Paul Carlton (US Air Force Surgeon General), etc. Schedule (see WWW for details): Monday = Arrival day, registration, and cocktail Tuesday = Gran Sasso Nat'l Lab tour, tutorials, and opening ceremony Wednesday/Thursday/Friday = Presentation of research papers Saturday = Tutorials and peripathetic discussions Sunday = Departure day Deadlines (see WWW for details): For title and abstract (about 100 words): October 15, 2002 (for Winter 2003) April 30, 2003 (for Summer 2003) For papers (IEEE Transactions format, min 4 pages, max 1MB): November 15, 2002 (for Winter 2003) May 30, 2003 (for Summer 2003) For payment (stay, and fee if applicable): December 10, 2002 (for Winter 2003) June 30, 2003 (for Summer 2003) Payment (see WWW for details): No conference fee for those with papers to present (others: euro600). No fee for tutorials. All participants must stay inside SSGRR (no outside stays allowed). Full 6-day stay (from Monday evening till Sunday breakfast): euro1200. A 5-day stay (without one tutorial day): euro1000. Minimal 4-day stay (for research papers only): euro 800. Favourable conditions for accompanying persons (see the WWW). For late payment rules see the WWW. Important (see WWW for details): When submitting your paper, insert the 3-letter field code (exact codes on WWW), so the placement of papers per sessions is more efficient. Insert your WWW site URL (if you have one). If you submit a paper, you will get 2 other papers for a fast review (in up to 10 days). Your presentation time is 25 minutes, plus 5 minutes for discussions. Chairman of the session is the presenter of the last paper in that session. Moving of presentation slots is not permitted (in cases of non-show-up). If you like to be reinvited for a future SSGRR conference, let us know. If you like to be removed from the list, please let us know, too. WE HOPE TO SEE YOU AT SSGRR! Professor Veljko Milutinovic, General Chairman From rlatimer@tjhsst.edu Mon Sep 16 14:57:57 2002 From: rlatimer@tjhsst.edu (Randy Latimer) Date: Mon, 16 Sep 2002 09:57:57 -0400 (EDT) Subject: [Edu-sig] Getting Started In-Reply-To: <006201c25d09$89791d60$6501a8c0@vaio> Message-ID: 1. Simple Question I want to load a python program and "run" it. For instance, from the tutorial: def countdown(n): if n == 0: print "Blastoff!" else: print n countdown(n-1) I save this as count.py. Go into python. Then what do I do? Here's the error message I'm getting: >>> import countdown >>> countdown(3) Traceback (most recent call last): File "", line 1, in ? TypeError: object of type 'module' is not callable >>> 2. What's the best way to do GUI in python? PyGTK? Thanks, Randy L From Jason Cunliffe" folding editor for Literate Programming Message-ID: <006b01c25e7a$c5707da0$6501a8c0@vaio> hmm... A thread on Flashcoders list [Flash ActionScript programming] about external editors introduced an interesting one: Leo """I know that a lot of folks have the same problems as i do - commenting code. I've found that 'outline editors' can really help with this kind of thing, and one that is excellent is Leo. It supports 'literate programming', but don't let that scare you! It just makes it easier to create the docs and the code at the same time. http://personalpages.tds.net/~edream/front.html Check out the online tutorial, and see what you think - its helped with the development and debugging of both python and flash projects. http://www.evisa.com/e/sbooks/leo/sbframetoc_ns.htm There is a quite active forum @ leo's source forge home too. http://sourceforge.net/forum/forum.php?forum_id=10226 Runs on all kinds of platforms, Open Source, etc etc... """ Here's a helpful testimonial also about it: http://personalpages.tds.net/~edream/SpeedReam.html "In actual practice, this organizational 'history' is so powerful that I can't begin to describe it. A reverse learning curve happens when an engineer gets a Leo file that already has the 'interrupt time sensitive' routines grouped together by the last unfortunate soul who had to work on them. There may not be any more written documentation, but the knowledge contained in the structure can be breathtaking. It is certainly timesaving. I find this particularly true in my own case. Often I'll look at some code that seems totally unfamiliar and think 'what idiot wrote this crap'. Then I'll look at the version control comments and realize that I wrote the crap. Then for sure I know the documentation is non-existent, but the clones I used to develop it are still there, and they always serve to refresh my memory in an indescribable way." ...................... PythonWin has nice folding editor because it is based on Scintilla. And PythonCard also? Python's implicit readability, docstrings, and white space indentation make it especially suitable for folding editors. Leo seems to go further with this than others. The idea invites some edu-sig insights. I am mostly suspicious of editors which junk up my screen with clunky symbols, like those ghastly early HTML ones. But also a happy veteran/fan of folding 'outline' editors. I had one {in EPROM} on my first computer - a Radio Shack Tandy Model 100 laptop. Since the screen was only a 8 lines high, it made especially ingenious good sense! What do you think? ./Jason ______________________________________________ Jason Cunliffe [NOMADICS: Director art+design] Tel/fax: +1 718 422-1078 jasonic@nomadics.org N 43:00.000' W 074:31.875' ALT:1144 ft 84 Henry Street #3C Brooklyn NY 11201 USA From Jason Cunliffe" folding editor for Literate Programming References: <006b01c25e7a$c5707da0$6501a8c0@vaio> Message-ID: <00c801c25e87$03b0a7a0$6501a8c0@vaio> [Idle-dev] leo.py 3.0 outlining editor Guido van Rossum guido@python.org Wed, 17 Jul 2002 16:35:50 -0400 http://mail.python.org/pipermail/idle-dev/2002-July/001068.html From Jason Cunliffe" folding editor for Literate Programming References: <006b01c25e7a$c5707da0$6501a8c0@vaio> <00c801c25e87$03b0a7a0$6501a8c0@vaio> Message-ID: <000701c25e88$cfebde60$6501a8c0@vaio> Chapter 7: Scripting Leo with Python This chapter tells how to create Python scripts to control Leo. This chapter assumes you are a proficient Python programmer. http://personalpages.tds.net/~edream/scripting.html Traversing outlines http://personalpages.tds.net/~edream/scripting.html#anchor684735 Leo seems destined for Python classroom use & curricula design. I see mention of upcoming wxWindows version of Leo Anyone know how this plays with PythonCard developments ? [I've not been keeping up] ./Jason From ajs@ix.netcom.com Wed Sep 18 02:53:43 2002 From: ajs@ix.netcom.com (Arthur) Date: Tue, 17 Sep 2002 21:53:43 -0400 Subject: [Edu-sig] 'Leo' => folding editor for Literate Programming Message-ID: <000501c25eb6$3ad9db50$9865fea9@arthur> Jason writes: >Leo seems destined for Python classroom use & curricula design. >I see mention of upcoming wxWindows version of Leo Not sure I agree. From a Slashdot article included in the Leo docs, """Hello, my full name is David Speed Ream. I am known as Speed to friends and enemies alike, but I gladly answer to David or most any other handle. I am an unabashed and biased fan of Leo, the fact that it was written by my brother Edward only slightly coloring my already colored glasses. For me, Leo's greatest and only real drawback is the learning curve.""" The article seems to position Leo as a serious production programmers tool. A learning curve it seems to me worth tackling after one has become a serious enough programmer. Can't help using myself as an example. My position has been that time that might be spent learning programming tools is much better spent, at my stage of things, learning programming. And I am pretty well convinced that the type, cut, paste and run text editor with which I have become somewhat facile is all the tool I need at this point. Nor will I let myself buy new golf clubs til I break 90 with some consistency. Because I know the clubs ain't the problem, and only when I become better will I be able to take advantage of what is better about better clubs. Art From Jason Cunliffe" folding editor for Literate Programming References: <000501c25eb6$3ad9db50$9865fea9@arthur> Message-ID: <000701c25ebf$0cfbfac0$6501a8c0@vaio> Hi Arthur > The article seems to position Leo as a serious production programmers tool. > A learning curve it seems to me worth tackling after one has become a > serious enough programmer. Yes. But but besides the exisiting professsional needs of large coding projects, I do believe Leo offers a valuable emerging new paradigm, one which may find its best home with beginners and people in small collaborative groups. Actually it is not a so new.. StorySpace, Hypercard, Smalltalk.. etc As you know I am easily enthused. But I was not trying insist or impose a meta-tool like this on beginners, though some may love it. Nor on people happy and productive with reliable flat text files. KISS works. One of he strongest arguements against LEO is that is makes files main dependant on the application, or at least noe wihdih wknows what to do with the format. It is not restricted to that, as you will see if you sue. You can 'flatten', import adn export in a variety ofways. Just like Photoshop from a multi-layered image complete with masks, paths, and macros. 1. I was thinking towards the needs of embedding code within other structured con-text. Like a good textbook, web how-to article, and so on. All of those could now be managed in a way which pemits lineaer flat files but also allows incremental versions to be run dynamically within the surrounding text. 2. It might make collaboration easier. 3. It might help the transition from concept to pseudocoide to source code easier. 4. It might encourage people to more freely step out and into their code. That's usful for both analytic and creative parts of programming. There's a good reason why many people love text-folding and colored syntax highlighting. It makes it easier for them, though not perhaps everyone. Mathemtica's revolutionary 'Notebook' interface is a good example of how one can combine hands-on programming with document structure and publishing/presentation needs. Blogs are contemporary example of similar trend. Distrubuited publishing via RSS and XML-PRC mechanisms. Expandable code cia short form presetation of articles with "more..." and "comments.." links. Better separation [and integration] of form and content. XML, CSS, theme, author, style/idnetity, calendar-based sequences of related and un-related content provide a ean way for people to follow the progression. 5. XML for better and worse is here to stay for at least a generation. The need to handle that alone is good argument for tools like LEO. Suppose you want to start discussing a pprblem and then build data model with your class. You can start with simple needs adn observations, collect several versions from stuents, merge adn improve the best candidates, write parser code and methods for handling the models etc.. Tedious and hard to do with regualar editors. Perhaps not solo, but in a group class siutatnio wher you want ot build up the workabee able to review it, pehaps extend with anouth school or class. You could use CVS, but here is a tool in Python for Python. sweet and manageable. > Can't help using myself as an example. My position has been that time that > might be spent learning programming tools is much better spent, at my stage > of things, learning programming. And I am pretty well convinced that the > type, cut, paste and run text editor with which I have become somewhat > facile is all the tool I need at this point. I do not doubt that. Once one can type even modestly well on a QWERTY keyboard, all other keyboards layouts are a painful distraction even if they are theoretically much better! But there is often great value in approaching problems from several perspectives. That's what my favorite Math teacher was good at when I was 14. If you were starting out without the habits you have now, you might be very appreciate of a tool which lets you go smoothly from high level to low level and back. Like the Zoom in a graphics app. Unthinkable now without it. Or resize on for windows, scrollbars, etc. What about indentation in Python. Expressly to clarify and simplify the code while imposing a consistent structure. Ditto docstrings. LEO appears to be a healthy product of those initial design decisions. The best argument I can make for LEO-like interfaces is that in the *right* hands they can improve thinking, design, understanding and presentation. It will take time to get these tools into a really good balance netween power and simplicity. The fist adn 2nd generation of Web development has sadly sold people on an extremely chaotic model where linsk typically take you *away* from the context. The rapid growth of Community Wikis alongside individual Blogs show people want better management of gathering and sharing their ideas, discoveries and work. I consdier the 3rd gernation of the Web now playing out. I think it much healthier than what came before. > Nor will I let myself buy new golf clubs til I break 90 with some > consistency. Because I know the clubs ain't the problem, and only when I > become better will I be able to take advantage of what is better about > better clubs. Granted. But remember, LEO is free btw, unlike those shiny new gold-plated titanium tipped, dayglo golf clubs you don't really need! ./Jason From ajs@ix.netcom.com Wed Sep 18 04:30:58 2002 From: ajs@ix.netcom.com (Arthur) Date: Tue, 17 Sep 2002 23:30:58 -0400 Subject: [Edu-sig] 'Leo' => folding editor for Literate Programming References: <000501c25eb6$3ad9db50$9865fea9@arthur> <000701c25ebf$0cfbfac0$6501a8c0@vaio> Message-ID: <000701c25ec3$ce808cc0$9865fea9@arthur> Jason - > Yes. But but besides the exisiting professsional needs of large coding projects, > I do believe Leo offers a valuable emerging new paradigm, one which may find its > best home with beginners and people in small collaborative groups. We, on the surface, at least, seem to have a tempermental difference. I guess I need to feel that I have outgrown the old paradigms before I go searching for new ones with too much vigor. Don't give myself that much credit. Geometry is about as old a paradigm as there gets. It seems to have kept me busy enough for a good stretch now. I espouse a paradigm of sitting down with compass and ruler and doing Euclid - soup to nuts. As a start. I love a good compass - especially the older ones, with nibs for ink. > The best argument I can make for LEO-like interfaces is that in the *right* > hands they can improve thinking, design, understanding and presentation. > Not arguing - though it sounds like I am, probably. L:eo looks intriguing. If I had the time, I'd defintiely look at it more closely - and hope that at some point I will. Unfortunately there are many such things on my list. Heady times we live in. Art > It will take time to get these tools into a really good balance netween power > and simplicity. The fist adn 2nd generation of Web development has sadly sold > people on an extremely chaotic model where linsk typically take you *away* from > the context. The rapid growth of Community Wikis alongside individual Blogs show > people want better management of gathering and sharing their ideas, discoveries > and work. I consdier the 3rd gernation of the Web now playing out. I think it > much healthier than what came before. > > > Nor will I let myself buy new golf clubs til I break 90 with some > > consistency. Because I know the clubs ain't the problem, and only when I > > become better will I be able to take advantage of what is better about > > better clubs. > > Granted. But remember, LEO is free btw, unlike those shiny new gold-plated > titanium tipped, dayglo golf clubs you don't really need! > > ./Jason > > > From Jason Cunliffe" folding editor for Literate Programming References: <000501c25eb6$3ad9db50$9865fea9@arthur> <000701c25ebf$0cfbfac0$6501a8c0@vaio> <000701c25ec3$ce808cc0$9865fea9@arthur> Message-ID: <000b01c25ec9$22084540$6501a8c0@vaio> > We, on the surface, at least, seem to have a tempermental difference. I > guess I need to feel that I have outgrown the old paradigms before I go > searching for new ones with too much vigor. Don't give myself that much > credit. Yes. Point taken. I bit my tongue even as I typed those hazylazy words "new paradigm". Let me re-phrase.. This looks like a good idea, and I hope is progress. > Geometry is about as old a paradigm as there gets. It seems to have kept me > busy enough for a good stretch now. I espouse a paradigm of sitting down > with compass and ruler and doing Euclid - soup to nuts. As a start. > > I love a good compass - especially the older ones, with nibs for ink. mmm yes. Let's go Egyptian string sand and sea shells :-) For years I treasured a little second hand Russian pamphlet I found on the Charing Cross road. 'Geometry with [only] rulers and compass' - meaning straighedge no measurements or protractors. A similar epiphany, but a lot more complex+expensive, was seeing Tom Davis's 'Geometer' running on an SGI for the first time about 10 years ago. http://www.sgi.com/fun/freeware/software.html [A cousin/ancestor of Geometer's Sketchpad] He's now involved in Math circles: http://www.geometer.org/mathcircles/index.html ...which perhaps proves that this stuff really goes to your head! ./Jason From ajs@ix.netcom.com Wed Sep 18 14:13:55 2002 From: ajs@ix.netcom.com (Arthur) Date: Wed, 18 Sep 2002 09:13:55 -0400 Subject: [Edu-sig] 'Leo' => folding editor for Literate Programming References: <000501c25eb6$3ad9db50$9865fea9@arthur> <000701c25ebf$0cfbfac0$6501a8c0@vaio> <000701c25ec3$ce808cc0$9865fea9@arthur> <000b01c25ec9$22084540$6501a8c0@vaio> Message-ID: <001f01c25f15$3fa5fd30$9865fea9@arthur> Jason - > He's now involved in Math circles: > http://www.geometer.org/mathcircles/index.html > > ...which perhaps proves that this stuff really goes to your head! Thanks much for that site. Don't know how I haven't run into it before. There's stuff there that I *am* going to make time for. Art From mike@frcatel.fri.utc.sk Thu Sep 19 11:27:27 2002 From: mike@frcatel.fri.utc.sk (Michal Kaukic) Date: Thu, 19 Sep 2002 12:27:27 +0200 (CEST) Subject: [Edu-sig] Python sequences by reference - how to make clear? In-Reply-To: <001f01c25f15$3fa5fd30$9865fea9@arthur> Message-ID: Hi, we like Python - I use it (with Numeric and SciPy modules) for teaching of Numerical analysis and my colleague is doing some research in discrete optimization in Python. And he often surprises me with non-conformal use of language :-) We are mathematicians, not programmers. I suppose, he believes that Python "thinks" like Mathematician. Yesterday, he was struggling with the code shown below (somewhat simplified): L_L=[[1,2,3], [2,3,4], [3,4,5]] def do_process(LL): n=len(LL[0]) rec = [0]*n Res=[] for row in LL: rec[0] = row[0] # further code - modifying rec # lots of conditional processing and such... # ... Res += [rec] return Res --------------------------------------------- After calling do_process(L_L), the "expected" result should be [[1, 0, 0], [2, 0, 0], [3, 0, 0]] but the true result is [[3, 0, 0], [3, 0, 0], [3, 0, 0]]. Yes, this is fully in accordance with how the Python language should behave: Res += [rec] inserts references to list object rec, which are further modified... (he should use copy(rec) instead). But there is nothing to make this behaviour clearly VISIBLE in code. If I work with pointers in C/C++ I know and see they are pointers. You can say - we also know that rec is list object and so be careful with it. Yes, but consider the complex code where the similar constructs are very easy to overlook. And debugging of such code can be frustrating. My colleague was in state of despair and made thoughtful remarks about FORTRAN and Python similarity. He believes that Python is corrupting his (computer) memory... So what is the point? I wrote this message in hope that there are more people with similar experience. My question is - how to explain to novice non-programmer users (maybe mathematically "infected") the quirks of Python sequence objects? Which methodology to use in programs so we can clearly see we work with "pointers"? Or maybe someone can propose the changes to the Language to overcome this (psychological) barrier? I feel this as a serious obstacle in using Python (my students experienced it too). Thanks, Mike From guido@python.org Thu Sep 19 15:03:53 2002 From: guido@python.org (Guido van Rossum) Date: Thu, 19 Sep 2002 10:03:53 -0400 Subject: [Edu-sig] Python sequences by reference - how to make clear? In-Reply-To: Your message of "Thu, 19 Sep 2002 12:27:27 +0200." References: Message-ID: <200209191403.g8JE3r402965@pcp02138704pcs.reston01.va.comcast.net> > So what is the point? I wrote this message in hope that there are > more people with similar experience. My question is - how to explain > to novice non-programmer users (maybe mathematically "infected") the > quirks of Python sequence objects? Which methodology to use in > programs so we can clearly see we work with "pointers"? Or maybe > someone can propose the changes to the Language to overcome this > (psychological) barrier? I feel this as a serious obstacle in using > Python (my students experienced it too). I usually draw a picture containing a few objects as boxes and a container as a separate box with arrows representing references to those boxes. I do this as early on in the tutorial as possible -- basically as soon as lists are covered. See e.g. page 16 of http://www.python.org/doc/essays/ppt/lwnyc2002/intro22.pdf (this discusses a slightly different guise of the same problem -- but it's really the same problem). --Guido van Rossum (home page: http://www.python.org/~guido/) From mkeller@noos.fr Thu Sep 19 09:49:38 2002 From: mkeller@noos.fr (Marc Keller) Date: Thu, 19 Sep 2002 10:49:38 +0200 Subject: [Edu-sig] Python sequences by reference - how to make clear? References: Message-ID: <3D898FA2.22D8EA16@noos.fr> I taught Algorithmics to mathematicians, and I had, of course, the same problems. But it seems to me that mathematicians have to be conscious of this difference between object and value of this object, which in is more precise than the dichotomy variable and value of this variable, but not contradictory. On another side it seems to me easier to explain to mathematician the notion of mutable-immutable objects than to explain pointers... In your example, if I change the position of the statement "rec = [0]*n" as in def do_process1(LL): n=len(LL[0]) Res=[] for row in LL: rec = [0]*n rec[0] = row[0] # further code - modifying rec # lots of conditional processing and such... # ... Res += [rec] return Res the result of: do_process1(L_L) is evidently [[1, 0, 0], [2, 0, 0], [3, 0, 0]] And even for mathematicians, it is evident that functions do_process and do_process1 are not automatically equivalent. Marc Keller #§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§ Michal Kaukic wrote: > > Hi, > > we like Python - I use it (with Numeric and SciPy modules) > for teaching of Numerical analysis and my colleague is doing > some research in discrete optimization in Python. And he often > surprises me with non-conformal use of language :-) > > We are mathematicians, not programmers. I suppose, he believes > that Python "thinks" like Mathematician. Yesterday, he was struggling > with the code shown below (somewhat simplified): > > > L_L=[[1,2,3], [2,3,4], [3,4,5]] > > def do_process(LL): > n=len(LL[0]) > rec = [0]*n > Res=[] > > for row in LL: > rec[0] = row[0] > # further code - modifying rec > # lots of conditional processing and such... > # ... > Res += [rec] > > return Res > > --------------------------------------------- > > After calling do_process(L_L), the "expected" result should be > > [[1, 0, 0], [2, 0, 0], [3, 0, 0]] > > but the true result is > > [[3, 0, 0], [3, 0, 0], [3, 0, 0]]. > > Yes, this is fully in accordance with how the Python language should behave: > Res += [rec] inserts references to list object rec, > which are further modified... (he should use copy(rec) instead). > > But there is nothing to make this behaviour clearly VISIBLE in code. > If I work with pointers in C/C++ I know and see they are pointers. > You can say - we also know that rec is list object and so be careful with it. > Yes, but consider the complex code where the similar constructs > are very easy to overlook. And debugging of such code can be frustrating. > > My colleague was in state of despair and made thoughtful remarks > about FORTRAN and Python similarity. He believes that Python is corrupting > his (computer) memory... > > So what is the point? I wrote this message in hope that there are more people > with similar experience. My question is - how to explain to novice non-programmer users > (maybe mathematically "infected") the quirks of Python sequence objects? Which methodology to use > in programs so we can clearly see we work with "pointers"? > Or maybe someone can propose the changes to the Language to overcome this (psychological) barrier? > I feel this as a serious obstacle in using Python (my students experienced it too). > > Thanks, > Mike > > _______________________________________________ > Edu-sig mailing list > Edu-sig@python.org > http://mail.python.org/mailman/listinfo/edu-sig From ajs@ix.netcom.com Thu Sep 19 19:57:34 2002 From: ajs@ix.netcom.com (Arthur) Date: Thu, 19 Sep 2002 14:57:34 -0400 Subject: [Edu-sig] Fw: Python sequences by reference - how to make clear Message-ID: <00db01c2600e$82f702b0$9865fea9@arthur> Michal writes - > >Yes, this is fully in accordance with how the Python language should > behave: > > Res += [rec] inserts references to list object rec, > > which are further modified... (he should use copy(rec) instead). > Yes, this issue in various guises bit me for some time after I began using Python (self.-taught, as a fist programming language). It had always seemed to me that if there were a copy operator, or (perferably, to me) that the functionality of the copy module were in the language core as a built_in, that I would have been on clearer notice that there was something fundamental in this area to which I needed to pay attention and become attuned. In looking into it I did find some discussion of the issue on python-list. Interestingly it was also math/Numeric folk who seemed to be rasing the question then and advocating something along the lines of a built_in operator for copying. I however think that the issue is quite real for anyone coming to Python without the benefit of either a programming background or a formal structure within which they are being taught the language. I have felt strongly that others have been too quick to advocate changes to the language to address "special needs" cases. And that the special needs cases of the novice have been *much* over-emphasized in discussions, in general. The "specialist" (as in most special) need of the the novice is to get themselves in a mindset of knowing that they are using a complicated tool, that they should expect the unexpected, and that there is a burden on them to get in step to the tool, the tool - in the case of Python (people who are not novices will assure them) , having done more than its share in meeting them at least half way. And I have confirmed to myself in the work I have been doing recently, which is specifcally addressed to the non-programmer, that at least some of those "special needs" can be quite adequately addressed by the right interface design, using Python's out of the box capabilities. That being said, and admitting to having little understanding of the full implications of a suggestion to make the copy function as built_in, I do believe, all things else being equal (which I suspect they are not), it would be quite helpful little amendment to the status quo. I use the word "little" - perhaps inappropriately, is the problem. Art OOPs. Sent this to python-list by mistake. Not sure what will be made of my starting a conversation in the middle. One advantage of having established a bad reputation, is that I have little reputation to protect. Have added a few thoughts, above, so the posts don't even match. Sloppy, as often I am. Oh well. From guido@python.org Thu Sep 19 20:24:40 2002 From: guido@python.org (Guido van Rossum) Date: Thu, 19 Sep 2002 15:24:40 -0400 Subject: [Edu-sig] Fw: Python sequences by reference - how to make clear In-Reply-To: Your message of "Thu, 19 Sep 2002 14:57:34 EDT." <00db01c2600e$82f702b0$9865fea9@arthur> References: <00db01c2600e$82f702b0$9865fea9@arthur> Message-ID: <200209191924.g8JJOfU03380@odiug.zope.com> > That being said, and admitting to having little understanding of the > full implications of a suggestion to make the copy function as > built_in, I do believe, all things else being equal (which I suspect > they are not), it would be quite helpful little amendment to the > status quo. I use the word "little" - perhaps inappropriately, is > the problem. What specific little amendment did you have in mind? And please don't tell me that it's my job as the language designer to fix it. If I thought it could be fixed I would have, now wouldn't I? --Guido van Rossum (home page: http://www.python.org/~guido/) From ajs@ix.netcom.com Thu Sep 19 20:32:20 2002 From: ajs@ix.netcom.com (Arthur) Date: Thu, 19 Sep 2002 15:32:20 -0400 Subject: [Edu-sig] Fw: Python sequences by reference - how to make clear References: <00db01c2600e$82f702b0$9865fea9@arthur> <200209191924.g8JJOfU03380@odiug.zope.com> Message-ID: <00ed01c26013$466ae190$9865fea9@arthur> Guido writes: > What specific little amendment did you have in mind? And please don't > tell me that it's my job as the language designer to fix it. If I > thought it could be fixed I would have, now wouldn't I? Couching it in as many disclaimers of ignorance of the full implications of the suggestion as I know how, I thought I had made the suggestion clear. That "copy" be a built_in, rather than imported functionality. If feasible, I am suggesting (rather, feel confident) that "little" change would be a big help - especially to the self-directed learner. Art From guido@python.org Thu Sep 19 20:37:39 2002 From: guido@python.org (Guido van Rossum) Date: Thu, 19 Sep 2002 15:37:39 -0400 Subject: [Edu-sig] Fw: Python sequences by reference - how to make clear In-Reply-To: Your message of "Thu, 19 Sep 2002 15:32:20 EDT." <00ed01c26013$466ae190$9865fea9@arthur> References: <00db01c2600e$82f702b0$9865fea9@arthur> <200209191924.g8JJOfU03380@odiug.zope.com> <00ed01c26013$466ae190$9865fea9@arthur> Message-ID: <200209191937.g8JJbdq03465@odiug.zope.com> > > What specific little amendment did you have in mind? And please > > don't tell me that it's my job as the language designer to fix it. > > If I thought it could be fixed I would have, now wouldn't I? > > Couching it in as many disclaimers of ignorance of the full > implications of the suggestion as I know how, I thought I had made > the suggestion clear. That "copy" be a built_in, rather than > imported functionality. If feasible, I am suggesting (rather, feel > confident) that "little" change would be a big help - especially to > the self-directed learner. Sorry, I may have missed that suggestion amidst your rhetoric. Assuming you're lobbying for a builtin named copy(), should it be a deep copy or a shallow copy? --Guido van Rossum (home page: http://www.python.org/~guido/) From pobrien@orbtech.com Thu Sep 19 21:01:08 2002 From: pobrien@orbtech.com (Patrick K. O'Brien) Date: Thu, 19 Sep 2002 15:01:08 -0500 Subject: [Edu-sig] Fw: Python sequences by reference - how to make clear In-Reply-To: <200209191937.g8JJbdq03465@odiug.zope.com> Message-ID: [Guido van Rossum] > > Sorry, I may have missed that suggestion amidst your rhetoric. > > Assuming you're lobbying for a builtin named copy(), should it be a > deep copy or a shallow copy? Is this question a red herring, Guido? Surely one would ask for both copy() and deepcopy(), the same functions exposed by the copy module. Of course, I'm not convinced having them as builtins solves the real problem. (Which is why I asked if the question was a red herring.) If anything, having these functions as builtins might lead to an excessive use of copying by the same individuals who hadn't yet gotten a handle on mutable versus immutable objects. Pat -- Patrick K. O'Brien Orbtech ----------------------------------------------- "Your source for Python programming expertise." ----------------------------------------------- Web: http://www.orbtech.com/web/pobrien/ Blog: http://www.orbtech.com/blog/pobrien/ Wiki: http://www.orbtech.com/wiki/PatrickOBrien ----------------------------------------------- From guido@python.org Thu Sep 19 21:06:56 2002 From: guido@python.org (Guido van Rossum) Date: Thu, 19 Sep 2002 16:06:56 -0400 Subject: [Edu-sig] Fw: Python sequences by reference - how to make clear In-Reply-To: Your message of "Thu, 19 Sep 2002 15:01:08 CDT." References: Message-ID: <200209192006.g8JK6ui05759@odiug.zope.com> > > Sorry, I may have missed that suggestion amidst your rhetoric. > > > > Assuming you're lobbying for a builtin named copy(), should it be a > > deep copy or a shallow copy? > > Is this question a red herring, Guido? Surely one would ask for both > copy() and deepcopy(), the same functions exposed by the copy > module. Of course, I'm not convinced having them as builtins solves > the real problem. (Which is why I asked if the question was a red > herring.) If anything, having these functions as builtins might lead > to an excessive use of copying by the same individuals who hadn't > yet gotten a handle on mutable versus immutable objects. Exactly. I'm trying to tease out what Arthur perceived the solution to be to the surprises with object aliasing. --Guido van Rossum (home page: http://www.python.org/~guido/) From ajs@ix.netcom.com Thu Sep 19 21:22:24 2002 From: ajs@ix.netcom.com (Arthur) Date: Thu, 19 Sep 2002 16:22:24 -0400 Subject: [Edu-sig] Fw: Python sequences by reference - how to make clear References: <200209192006.g8JK6ui05759@odiug.zope.com> Message-ID: <010e01c2601a$464a3600$9865fea9@arthur> > > > Sorry, I may have missed that suggestion amidst your rhetoric. > > > > > > Assuming you're lobbying for a builtin named copy(), should it be a > > > deep copy or a shallow copy? > > > > Is this question a red herring, Guido? Surely one would ask for both > > copy() and deepcopy(), the same functions exposed by the copy > > module. Of course, I'm not convinced having them as builtins solves > > the real problem. (Which is why I asked if the question was a red > > herring.) If anything, having these functions as builtins might lead > > to an excessive use of copying by the same individuals who hadn't > > yet gotten a handle on mutable versus immutable objects. > > Exactly. I'm trying to tease out what Arthur perceived the solution > to be to the surprises with object aliasing. > My contention is simple. And nothing I am in a position to prove, with any amount of rhetoric. Copy as built_in simply puts a whole area of fundamentals on the table as fundamental. It is as important to understand why you are not copying when you are not, as why you are copying when you are. "Copy" is not CGI or tokenize. If I am convinced that I would have confronted and overcome some of this confusion much sooner in the process (and that I am typical) had I found copy as a built_in, what is the suggestion for lending some weight to this contention? Art From ajs@ix.netcom.com Thu Sep 19 21:43:41 2002 From: ajs@ix.netcom.com (Arthur) Date: Thu, 19 Sep 2002 16:43:41 -0400 Subject: [Edu-sig] Fw: Python sequences by reference - how to make clear References: <200209192006.g8JK6ui05759@odiug.zope.com> <010e01c2601a$464a3600$9865fea9@arthur> <200209192030.g8JKUog06305@odiug.zope.com> Message-ID: <011401c2601d$3fe16790$9865fea9@arthur> > > > > > Assuming you're lobbying for a builtin named copy(), should it be a > > > > > deep copy or a shallow copy? > > Arthur, can you please answer this? > Would it shock you to know that I don't have the understanding to try to answer that beyond saying the functionality of [:] slicing as to a list is the common use case - for folks like I. Art From ajs@ix.netcom.com Thu Sep 19 21:55:00 2002 From: ajs@ix.netcom.com (Arthur) Date: Thu, 19 Sep 2002 16:55:00 -0400 Subject: [Edu-sig] Fw: Python sequences by reference - how to make clear References: <200209192006.g8JK6ui05759@odiug.zope.com> <010e01c2601a$464a3600$9865fea9@arthur> <200209192030.g8JKUog06305@odiug.zope.com> Message-ID: <011801c2601e$ec56c4b0$9865fea9@arthur> Guido writes: > The usual way to make a case for a language (or library) feature is to > show a simple but recognizably common coding fragment that would have > been made clearer or easier to write (etc.) when the proposed feature > is present. Is it fair for me to suggest that this is not a situation that lends itself to this kind of approach. Trying to introspect on one's own learning experience perhaps brings into play factors that are truly intangible, but no less real. What it boils down to is just a few questions: My experience is sincerely reported, or it is not. I am properly understanding that experience, or I am not. My experience can be generalized, or it can not. My suggestion is intutively sensible, or it is not. I am not unwillingly to try to do better than not, but I don't see how to conform any such effort into the methodology you suggest. Art. From Jason Cunliffe" <200209192006.g8JK6ui05759@odiug.zope.com> <010e01c2601a$464a3600$9865fea9@arthur> <200209192030.g8JKUog06305@odiug.zope.com> <011801c2601e$ec56c4b0$9865fea9@arthur> Message-ID: <00f801c26023$84cdd900$6501a8c0@vaio> > I am not unwillingly to try to do better than not, but I don't see how to > conform any such effort into the methodology you suggest. I think all he's asking/hoping for is an example in Python. You now are aware enough of copy() to be asking for it to become built_in. So please: 1. Try to construct an example of a python problem you may have encountered at the very beginning. 2. Then what you did to involve copy() [ when & how did you realize ? what precisely did you do ? ] 3. Next what you'd like to do in the new/improved future. {medium += message} If your experiences and personal insights are familiar enough to other novices, and thus have broad merit, then Python code examples are the best way to gain influence and spread the idea. {personal note} I suffer also from lots of valuable insights and ideas about Python, but still struggle hard to express them in Python. Hell, I even struggle to get them into simple prose. My best are series of sketches on 5x8 blank white cards I use. Until email/web/xyz-net supports that, I am *not* satisfied. I spend a good deal of my time learning to program so I can make it happen. That's what led me to Python in the first place! keep trying ./Jason From guido@python.org Thu Sep 19 21:50:56 2002 From: guido@python.org (Guido van Rossum) Date: Thu, 19 Sep 2002 16:50:56 -0400 Subject: [Edu-sig] Fw: Python sequences by reference - how to make clear In-Reply-To: Your message of "Thu, 19 Sep 2002 16:43:41 EDT." <011401c2601d$3fe16790$9865fea9@arthur> References: <200209192006.g8JK6ui05759@odiug.zope.com> <010e01c2601a$464a3600$9865fea9@arthur> <200209192030.g8JKUog06305@odiug.zope.com> <011401c2601d$3fe16790$9865fea9@arthur> Message-ID: <200209192050.g8JKouQ06498@odiug.zope.com> > > > > > > Assuming you're lobbying for a builtin named copy(), > > > > > > should it be a deep copy or a shallow copy? > > > > Arthur, can you please answer this? > > > Would it shock you to know that I don't have the understanding to > try to answer that beyond saying the functionality of [:] slicing as > to a list is the common use case - for folks like I. That's a shallow copy. (There aren't any folks like you, Arthur. :-) Can you answer my *other* suggestion, give a programming example that would be better if copy() were a builtin? --Guido van Rossum (home page: http://www.python.org/~guido/) From guido@python.org Thu Sep 19 22:03:10 2002 From: guido@python.org (Guido van Rossum) Date: Thu, 19 Sep 2002 17:03:10 -0400 Subject: [Edu-sig] Fw: Python sequences by reference - how to make clear In-Reply-To: Your message of "Thu, 19 Sep 2002 16:55:00 EDT." <011801c2601e$ec56c4b0$9865fea9@arthur> References: <200209192006.g8JK6ui05759@odiug.zope.com> <010e01c2601a$464a3600$9865fea9@arthur> <200209192030.g8JKUog06305@odiug.zope.com> <011801c2601e$ec56c4b0$9865fea9@arthur> Message-ID: <200209192103.g8JL3AW06892@odiug.zope.com> > > The usual way to make a case for a language (or library) feature is to > > show a simple but recognizably common coding fragment that would have > > been made clearer or easier to write (etc.) when the proposed feature > > is present. > > Is it fair for me to suggest that this is not a situation that lends itself > to this kind of approach. > > Trying to introspect on one's own learning experience perhaps brings into > play factors that are truly intangible, but no less real. > > What it boils down to is just a few questions: > > My experience is sincerely reported, or it is not. > > I am properly understanding that experience, or I am not. > > My experience can be generalized, or it can not. > > My suggestion is intutively sensible, or it is not. > > I am not unwillingly to try to do better than not, but I don't see how to > conform any such effort into the methodology you suggest. This sounds like the "zen" approach to language feature suggestions. You are convinced that a copy() method should be added yet are unable to provide a single example. I accept that it is hard for you to come up with an example. Until you have introspected enough to come up with an example I do not consider your testimony enough to change the language. I think that is fair too. --Guido van Rossum (home page: http://www.python.org/~guido/) From guido@python.org Thu Sep 19 21:30:50 2002 From: guido@python.org (Guido van Rossum) Date: Thu, 19 Sep 2002 16:30:50 -0400 Subject: [Edu-sig] Fw: Python sequences by reference - how to make clear In-Reply-To: Your message of "Thu, 19 Sep 2002 16:22:24 EDT." <010e01c2601a$464a3600$9865fea9@arthur> References: <200209192006.g8JK6ui05759@odiug.zope.com> <010e01c2601a$464a3600$9865fea9@arthur> Message-ID: <200209192030.g8JKUog06305@odiug.zope.com> > > > > Sorry, I may have missed that suggestion amidst your rhetoric. > > > > > > > > Assuming you're lobbying for a builtin named copy(), should it be a > > > > deep copy or a shallow copy? Arthur, can you please answer this? > > > Is this question a red herring, Guido? Surely one would ask for both > > > copy() and deepcopy(), the same functions exposed by the copy > > > module. Of course, I'm not convinced having them as builtins solves > > > the real problem. (Which is why I asked if the question was a red > > > herring.) If anything, having these functions as builtins might lead > > > to an excessive use of copying by the same individuals who hadn't > > > yet gotten a handle on mutable versus immutable objects. > > > > Exactly. I'm trying to tease out what Arthur perceived the solution > > to be to the surprises with object aliasing. > > My contention is simple. And nothing I am in a position to prove, with any > amount of rhetoric. Copy as built_in simply puts a whole area of > fundamentals on the table as fundamental. It is as important to understand > why you are not copying when you are not, as why you are copying when you > are. "Copy" is not CGI or tokenize. > > If I am convinced that I would have confronted and overcome some of this > confusion much sooner in the process (and that I am typical) had I found > copy as a built_in, what is the suggestion for lending some weight to this > contention? The usual way to make a case for a language (or library) feature is to show a simple but recognizably common coding fragment that would have been made clearer or easier to write (etc.) when the proposed feature is present. --Guido van Rossum (home page: http://www.python.org/~guido/) From ajs@ix.netcom.com Thu Sep 19 23:43:02 2002 From: ajs@ix.netcom.com (Arthur) Date: Thu, 19 Sep 2002 18:43:02 -0400 Subject: [Edu-sig] Fw: Python sequences by reference - how to make clear References: <200209192006.g8JK6ui05759@odiug.zope.com> <010e01c2601a$464a3600$9865fea9@arthur> <200209192030.g8JKUog06305@odiug.zope.com> <011801c2601e$ec56c4b0$9865fea9@arthur> <200209192103.g8JL3AW06892@odiug.zope.com> Message-ID: <012801c2602e$01461f10$9865fea9@arthur> Guido writes - > You are convinced that a copy() method should be added yet are unable > to provide a single example. > > I accept that it is hard for you to come up with an example. > > Until you have introspected enough to come up with an example I do not > consider your testimony enough to change the language. I think that > is fair too. But I have tried to articulate why the methodology on which you insist is not responsive to the entire basis of what I am suggesting is the issue. The best I can try to do is a double whammy of issues. I'll verbalize, and try to follow up with code - though I think my point is made better in the rhetoric better than I can make it in code. The list.remove(x) trap on a list over which one is iterating. I think it is fair to say that this is generally recognized as a gotcha that gets most of us somewhere along the line. Now the answer usually is iterating over a [:] copy and removing from the list itself. But that [:] is effective as a operator for a shallow copy seems more a happenstance/side-effect than a feature. Would you agree that copy were more core if [:] didn't work as an instead. But [:] is a slice operator, we are taught. Early on. And we begin to understand how it works. [0] means 1 not 0. -1 last. Good stuff to start to get a handle on. But there is no association with copying. "Copy" should be associated with copying. Or by having "copy" there is front of us in dir(__builtins__) we are on notice it comes into to play in basic ways. The answer to the list.reomve(x) issue should be less of a blindside, or at least seem like less of a happenstance. But by the nature of a methodology you might establish it might be much easier to prove to you that the newbie needs [1] to be the first list item, not the second. I promise you I can produce an experiment that will prove that this is true. God forbid you should act on it. So in some way the methdology you elect determines the answers you get. And you probably *can't* get my answer by your methodolgy. But that doesn't make it Zen. Art From urnerk@qwest.net Thu Sep 19 23:53:26 2002 From: urnerk@qwest.net (Kirby Urner) Date: Thu, 19 Sep 2002 15:53:26 -0700 Subject: [Edu-sig] Fw: Python sequences by reference - how to make clear In-Reply-To: <00f801c26023$84cdd900$6501a8c0@vaio> References: <200209192006.g8JK6ui05759@odiug.zope.com> <010e01c2601a$464a3600$9865fea9@arthur> <200209192030.g8JKUog06305@odiug.zope.com> <011801c2601e$ec56c4b0$9865fea9@arthur> Message-ID: <5.1.1.6.0.20020919151415.029c6ad0@pop.ptld.qwest.net> If copy and deepcopy *were* to be incorporated into the built-in domain, perhaps where they'd logically appear is as methods in the new base class (object). >>> newobj = object() >>> dir(newobj) ['__class__', '__delattr__', '__doc__', '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__repr__', '__setattr__', '__str__'] In this hypothetical future, the above list would have included __copy__ and __deepcopy__ as well (except I'm not sure we need the underlines). Then the syntax would imitate hash(), which also appears as a builtin: >>> hash(newobj) 10746256 >>> newobj.__hash__() 10746256 Note: I'm aware that builtin functions don't always invoke object methods. For example id() doesn't trigger an __id__ method (probably because Python needs to control this directly -- can't have users messing with it by overriding it). However, in the case of hash, it does seem to trigger whatever has been defined for that object, as show by this experiement: >>> class Myobj(object): def __hash__(self): return 42 >>> obj = Myobj() >>> hash(obj) 42 >>> id(obj) # no __id__ method 30306080 copy(obj) would work this same way, by triggering obj's __copy__ method. So then, when wanting a copy of a list, say, you could just go: >>> a = [1,2,3,4] >>> b = copy(a) # invokes a.copy() (or a.__copy__() ?) >>> c = a >>> c[2]=5 >>> a # <---- is is the kind of thing that confuses newbies [1, 2, 5, 4] instead of: >>> import copy # <--- makes copying more remote than hashing >>> a = [1,2,3,4] >>> b = copy.copy(a) But of course, currently a user needn't import copy in order to copy a list: >>> a = [1,2,3] >>> b = a[:] # this works -- but is syntax specific to lists When we use dictionaries, we find something interesting: >>> a = {'a':1,'b':2} >>> dir(a) ['__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'] A copy method appears in the list of methods which dictionaries natively support. However, this doesn't mean you can use copy(a) the way you'd go hash(a). You have to go b = a.copy(). But were this new feature implemented, copy(a) would make sense, without importing the copy module. To summarize, one way of implementing Arthur's suggestion would be to move copy and deepcopy to the top of the class hierarchy, and to have the builtin copy(obj) invoke whatever's been defined inside obj's class definition. I don't think this model is too far-fetched by the way. Doesn't Java define the clonable interface as part of the base class, or somewhere high up in the hierarchy? That foundation objects should know how to copy themselves (either shallowly or deeply) seems a pretty intrinsic ability that it wouldn't hurt to have, or at least think about having. Kirby From Jason Cunliffe" <200209192006.g8JK6ui05759@odiug.zope.com> <010e01c2601a$464a3600$9865fea9@arthur> <200209192030.g8JKUog06305@odiug.zope.com> <011801c2601e$ec56c4b0$9865fea9@arthur> <5.1.1.6.0.20020919151415.029c6ad0@pop.ptld.qwest.net> Message-ID: <017801c26031$a737a120$6501a8c0@vaio> > That foundation objects should know how to copy themselves (either > shallowly or deeply) seems a pretty intrinsic ability that it wouldn't > hurt to have, or at least think about having. > > Kirby Thanks for the lucid sequence of examples Kirby ! Now I have a much better handle on what is being discussed here. ./Jason From Jason Cunliffe" #1 ImportError: No module named xyz Message-ID: <001201c26040$bd23ab00$6501a8c0@vaio> Hello I've posted here on this before, and naturally received supportive answers. But it just keeps coming up, especially after upgrading/reinstalling Python. Since this is Edu-Sig, and we're on the topic of novice obstacles, I'd love hear your fresh opinions... 1. I downloaded installed Leo, a new Python package. A simple process and it runs great..yay! Leo even lets me open a familiar Python shell directly [Idle/Tk] where I can successfully explore Leo's Python API examples: Chapter 7: Scripting Leo with Python http://personalpages.tds.net/~edream/scripting.html 2. The manual mentions I can invoke Leo from Python. So I launch Idle and try: Python 2.2.1 (#34, Apr 9 2002, 19:34:33) [MSC 32 bit (Intel)] on win32 >>> import leo >>> import leo Traceback (most recent call last): File "", line 1, in ? import leo ImportError: No module named leo >>> find leo SyntaxError: invalid syntax >>> find(leo) Traceback (most recent call last): File "", line 1, in ? find(leo) NameError: name 'find' is not defined 3. arghh.. Clearly the problem is a simple one. My Python IDLE knows not where 'Leo' module is, but Leo does know where Python is. I've been through this Python import pain enough times so I know how to fix it: >>> import sys >>> sys.path ['C:\\PYTHON22\\Tools\\idle', 'C:\\Python22', 'C:\\PYTHON22\\DLLs', 'C:\\PYTHON22\\lib', 'C:\\PYTHON22\\lib\\lib-tk', 'C:\\PYTHON22\\lib\\site-packages'] >>> sys.path.append('c:\\program files\\leo') >>> import leo >>> leo >>> ok :-) 4. Next time I launch Python from Idle, I have to go through this again, until I learn how to manage import paths via shell, in scripts and with persistent additions to sys.path also. 5. For a novice I believe this is waay too obstructive. Its geeky, and non-intuitive. I am *not* proposing to dumb down Python. But I am proposing to give timely novice crucial help, where needed. The 'import leo' exercise involves a very sophisticated Python application, but exactly the same is true if I write the simplest 'helloworld.py' and save it almost anywhere on my computer. 6. What to do? What do I propose? I suggest that ImportError is #1 all-time Python novice gotcha. For god sakes help people.. Suggestion A. HELPFUL ERROR PROMPT Instead of >>> import helloworld Traceback (most recent call last): File "", line 1, in ? import leo ImportError: No module named helloworld How about >>> import helloworld Traceback (most recent call last): File "", line 1, in ? import leo ImportError: No module named helloworld *** Python needs to know where "helloworld" is located. import sys sys.path # Shows which directories Python knows to search and load from. You must add the path where "helloworld" is located, then try import again sys.path.append('C:\\path-to-hello=world\\') I am sure you can improve upon this help prompt. Python programmers know perfectly well what to do. It in the tutorials and docs. But why not serve it up for beginners. A "novice-help-prompt-config.py" file could be bundled with Python to allow people to control and modify it. For example a teacher could add urls to docs, on-line courseware notes. Also localize the paths advice better to reflect local operating system locations more cleanly. Sophisticated Python Pros could disable these novice messages with a single line: novice-prompts = OFF User logins, machine IPs and other contexts could be used also to invoke, disable or switch the messages [LongFormTutorial, French, Korean, etc..] Suggestion B. ACTION ERROR PROMPT This version says don't just suggest, do something. In other words run 'import sys' and 'sys.path'. Then ask the user if Python should search the system for possible locations of 'helloworld' If Python finds any, return a visible command list and ask which one to invoke, always using the official sys.path.append() syntax so they can learn the syntax pattern quickly. Since searching for 'helloworld' could be time consuming and error prone, the "novice-help-prompt-config.py" could limit or prioritize the automated find path. Just like any operating system find tool. You may argue that students should learn to use find and be more responsible for files. Of course they should, but it takes time and out-of-the-box Python is unfriendly and terse. I argue, that to help true beginners, *Python* should learn to "use 'find' and be responsible for files"! Suggestion C. LONG-TERM & STRATEGIC HELP Assuming students may want to avoid the error next time they launch Python, what can we do? Well one idea is keep an error history, and parse it see if there are repeats. Another is provide help to reduce the problem directly by showing how. For example show how to make this persistent: sys.path.append('C:\\python\\edu-sig\\helloworld\\]) And next time student logs in and launches Python, the prompt can show what was added to sys.path. We cannot anticipate everything.. and don't need to. That's why this is titled the "Top 5 All-Time Novice Obstacles" Python could be much smarter and friendlier to novices. The tools and experience are not lacking. ./Jason From Jason Cunliffe" IDLE ? References: <001201c26040$bd23ab00$6501a8c0@vaio> Message-ID: <001001c26047$96877740$6501a8c0@vaio> http://www.python.org/idle/doc/idlemain.html and most other sources claim: IDLE is an acronym of "Integrated DeveLopment Environment" For students we need to put the "Learning" back in IDLE: IDLE => Integrated Development Learning Environment ./Jason From dblank@brynmawr.edu Fri Sep 20 04:08:48 2002 From: dblank@brynmawr.edu (Douglas S. Blank) Date: Fri, 20 Sep 2002 03:08:48 -0000 Subject: [Edu-sig] Fw: Python sequences by reference - how to make clear In-Reply-To: <5.1.1.6.0.20020919151415.029c6ad0@pop.ptld.qwest.net> Message-ID: <200209200309.g8K3908U026992@ada.brynmawr.edu> I'm not advocating anything, but provide the following only as data points on common mistakes. Kirby makes some good points to consistency, but I'm not sure what would change to help clear up the confusion that new users might have. For example, here are two examples that seem to work initially, but then cause debugging later to figure out what went wrong: 1. Creating multi-dimensional arrays of objects using the * operator: >>> a = [0] * 5 >>> a[0] = 4 >>> a [4, 0, 0, 0, 0] works as expected, but: >>> a = [[0] * 5] * 3 >>> a[0][0] = 4 >>> a [[4, 0, 0, 0, 0], [4, 0, 0, 0, 0], [4, 0, 0, 0, 0]] does not. 2. And, of course, the assignment operator: >>> a = [0] * 6 >>> b = a >>> a[0] = 2 >>> b [2, 0, 0, 0, 0, 0] versus, >>> a = [0] * 6 >>> b = a[:] >>> a[0] = 2 >>> b [0, 0, 0, 0, 0, 0] But, as Kirby mentioned, the [:] syntax only works with lists. A .copy() method for all objects could be used on both examples above: >>> a = [[0] * 5].copy() * 3 or even a newbie overgeneralized: >>> a = [[0].copy() * 5].copy() * 3 and, for the other: >>> b = a.copy() I would assume that copy() would be a deepcopy by default (as that would be what new users would assume). So, that might suggest a shallowcopy() method too. -Doug Kirby Urner said: > > If copy and deepcopy *were* to be incorporated into the built-in domain, > perhaps where they'd logically appear is as methods in the new base > class (object). [snip] > > Kirby > > > > _______________________________________________ > Edu-sig mailing list > Edu-sig@python.org > http://mail.python.org/mailman/listinfo/edu-sig > -- Douglas S. Blank, Assistant Professor dblank@brynmawr.edu, (610)526-6501 Bryn Mawr College, Computer Science Program 101 North Merion Ave, Park Science Building Bryn Mawr, PA 19010 dangermouse.brynmawr.edu From ajs@ix.netcom.com Fri Sep 20 04:38:49 2002 From: ajs@ix.netcom.com (Arthur) Date: Thu, 19 Sep 2002 23:38:49 -0400 Subject: [Edu-sig] Fw: Python sequences by reference - how to make clear References: <200209200309.g8K3908U026992@ada.brynmawr.edu> Message-ID: <014f01c26057$3eb0a360$9865fea9@arthur> > I'm not advocating anything, but provide the following only as data points on > common mistakes. Just to try to clear the air a bit, I don't want either to be seen as advocating anything - at least in the sense of having some strong sense of mission or righteousness on the issue. The status quo did not defeat me, and I don't think it will defeat anyone else with a willingness to persevere. Consider it a suggestion, and a suggestion I wouldn't even make if I thought it was other than a minor tweak to the configuration of Python and a 0 change to the substance of Python. I am still trying to digest Kirby's take on it. And no I would not expect Guido to change anything on the report of my experience. The only question is whether anything I am reporting might ring true to Guido and stimulate an approach that might be somehow both minimal and effective If not, not. Art From Jason Cunliffe" #2 Helping help References: <001201c26040$bd23ab00$6501a8c0@vaio> Message-ID: <003301c26060$cb61b3e0$6501a8c0@vaio> Title: ['Nine hours to Rama', '12 steps to help()'] ---Scenario: Novice Pythonista {NP} is exploring--- 1. >>> import os 2. >>> os 3. >>> dir(os) ['F_OK', 'O_APPEND', 'O_BINARY', 'O_CREAT', 'O_EXCL', 'O_RDONLY', 'O_RDWR', 'O_TEXT', 'O_TRUNC', 'O_WRONLY', 'P_DETACH', 'P_NOWAIT', 'P_NOWAITO', 'P_OVERLAY', 'P_WAIT', 'R_OK', 'TMP_MAX', 'UserDict', 'W_OK', 'X_OK', '_Environ', '__all__', '__builtins__', '__doc__', '__file__', '__name__', '_copy_reg', '_execvpe', '_exists', '_exit', '_get_exports_list', '_make_stat_result', '_make_statvfs_result', '_notfound', '_pickle_stat_result', '_pickle_statvfs_result', 'abort', 'access', 'altsep', 'chdir', 'chmod', 'close', 'curdir', 'defpath', 'dup', 'dup2', 'environ', 'error', 'execl', 'execle', 'execlp', 'execlpe', 'execv', 'execve', 'execvp', 'execvpe', 'extsep', 'fdopen', 'fstat', 'getcwd', 'getenv', 'getpid', 'i', 'isatty', 'linesep', 'listdir', 'lseek', 'lstat', 'makedirs', 'mkdir', 'name', 'open', 'pardir', 'path', 'pathsep', 'pipe', 'popen', 'popen2', 'popen3', 'popen4', 'putenv', 'read', 'remove', 'removedirs', 'rename', 'renames', 'rmdir', 'sep', 'spawnl', 'spawnle', 'spawnv', 'spawnve', 'startfile', 'stat', 'stat_result', 'statvfs_result', 'strerror', 'sys', 'system', 'tempnam', 'times', 'tmpfile', 'tmpnam', 'umask', 'unlink', 'unsetenv', 'utime', 'write'] ---{NP thinks:} "hmmm.. I wonder what that 'lstat' is?" 4. >>> os.lstat 5. >>> os.lstat() Traceback (most recent call last): File "", line 1, in ? os.lstat() TypeError: lstat() takes exactly 1 argument (0 given) ---{NP:} "[sigh].. I need some help" 6. >>> ? os.lstat() SyntaxError: invalid syntax ---{NP:} "oops1 wrong language ;-) [Rebol] 7. >>> help Type help() for interactive help, or help(object) for help about object. ---{NP:} "thanks!" 8. >>> help(os.lstat()) Traceback (most recent call last): File "", line 1, in ? help(os.lstat()) TypeError: lstat() takes exactly 1 argument (0 given) ---{NP:} "What the f*** ?" 9. >>> help(os.lstat) Help on built-in function lstat: lstat(...) lstat(path) -> (st_mode, st_ino, st_dev, st_nlink, st_uid, st_gid, st_size, st_atime, st_mtime, st_ctime) Like stat(path), but do not follow symbolic links. ---{NP:} "Aha.. :-)" [just then NP remembers about that wierd looking __doc__ thingie] 10. >>> os.lstat()__doc__ SyntaxError: invalid syntax ---{NP:} "..sheesh!doh well maybe I should try it this way => " 11. >>> os.lstat.__doc__ 'lstat(path) -> (st_mode, st_ino, st_dev, st_nlink, st_uid, st_gid,\n st_size, st_atime, st_mtime, st_ctime)\nLike stat(path), but do not follow symbolic links.' ---{NP:} "hmm almost but it looks messy. I liked help() better" 12. >>> print os.lstat.__doc__ lstat(path) -> (st_mode, st_ino, st_dev, st_nlink, st_uid, st_gid, st_size, st_atime, st_mtime, st_ctime) Like stat(path), but do not follow symbolic links. ---{NP:} [smiles] NP SUGGESTION When Novice Pythonistas get to steps 5. and 8. above, surely Python can help by jumping in with help(os.lstat)? ./Jason From ajs@ix.netcom.com Fri Sep 20 06:42:09 2002 From: ajs@ix.netcom.com (Arthur) Date: Fri, 20 Sep 2002 01:42:09 -0400 Subject: [Edu-sig] Top 5 All Time Novice Obstacles => #2 Helping help Message-ID: <016601c26068$76ab0560$9865fea9@arthur> Title: ['Tough Love, or 'Are we paying attention yet?'] ---Scenario: Socratic Genie {SG} is holding forth--- 1. >>> import os You rang,master 2. >>> os SG: Yo, my name is,my name is,my name 3. >>> dir(os) ['F_OK', 'O_APPEND', 'O_BINARY', 'O_CREAT', 'O_EXCL', 'O_RDONLY', 'O_RDWR', 'O_TEXT', 'O_TRUNC', 'O_WRONLY', 'P_DETACH', 'P_NOWAIT', 'P_NOWAITO', 'P_OVERLAY', 'P_WAIT', 'R_OK', 'TMP_MAX', 'UserDict', 'W_OK', 'X_OK', '_Environ', '__all__', '__builtins__', '__doc__', '__file__', '__name__', '_copy_reg', '_execvpe', '_exists', '_exit', '_get_exports_list', '_make_stat_result', '_make_statvfs_result', '_notfound', '_pickle_stat_result', '_pickle_statvfs_result', 'abort', 'access', 'altsep', 'chdir', 'chmod', 'close', 'curdir', 'defpath', 'dup', 'dup2', 'environ', 'error', 'execl', 'execle', 'execlp', 'execlpe', 'execv', 'execve', 'execvp', 'execvpe', 'extsep', 'fdopen', 'fstat', 'getcwd', 'getenv', 'getpid', 'i', 'isatty', 'linesep', 'listdir', 'lseek', 'lstat', 'makedirs', 'mkdir', 'name', 'open', 'pardir', 'path', 'pathsep', 'pipe', 'popen', 'popen2', 'popen3', 'popen4', 'putenv', 'read', 'remove', 'removedirs', 'rename', 'renames', 'rmdir', 'sep', 'spawnl', 'spawnle', 'spawnv', 'spawnve', 'startfile', 'stat', 'stat_result', 'statvfs_result', 'strerror', 'sys', 'system', 'tempnam', 'times', 'tmpfile', 'tmpnam', 'umask', 'unlink', 'unsetenv', 'utime', 'write'] SG: You're desire? 4. >>> os.lstat SG: Yo, my name is,my name is,my name 5. >>> os.lstat() SG: Happy to lstat for you. Lstat what? 6. >>> ? os.lstat() SyntaxError: invalid syntax SG: Not even close. Why not try "ertjke;" for that matter? 7. >>> help SG: How hard did I make that? >Type help() for interactive help, or help(object) for help about object. Now you know what help is. Do you wish me to perform it? ["()", "perform" - anything getting through yet?] 8. >>> help(os.lstat()) Traceback (most recent call last): File "", line 1, in ? help(os.lstat()) TypeError: lstat() takes exactly 1 argument (0 given) Come on. help(object) was the incantation I suggested. Does () make an object a wish or a wish an object? 9. >>> help(os.lstat) SG: Are we learning something? Help on built-in function lstat: lstat(...) lstat(path) -> (st_mode, st_ino, st_dev, st_nlink, st_uid, st_gid, st_size, st_atime, st_mtime, st_ctime) Like stat(path), but do not follow symbolic links. 10. >>> os.lstat()__doc__ SyntaxError: invalid syntax SG: Now, do you *really* think a () belongs there? [patience, patience] 11. >>> os.lstat.__doc__ SG: Had a problem with help(os.lstat)? And you were expecting maybe? 12. >>> print os.lstat.__doc__ SG: Hey buddy you looking to lstat or are we just playing games here? SG QUESTION Have you enjoyed our session on the meaning of ()? Oh yeah .. and something about lstat came up to, didn't it? From Jason Cunliffe" #3 Where am I ? References: <001201c26040$bd23ab00$6501a8c0@vaio> <003301c26060$cb61b3e0$6501a8c0@vaio> Message-ID: <004b01c26071$30a3b040$6501a8c0@vaio> Title: ["If you don't know where you're going, you might just end up somewhere else!"] ---Scenario: Novice Pythonista {NP} wants to write a script to generate a list of files of a certain type. Hopes to grow this into a cgi script to generate auto-linked directory pages in HTML --- ---{NP thinks:} "hmmm.. Where am I?" Python 2.2.1 (#34, Apr 9 2002, 19:34:33) [MSC 32 bit (Intel)] on win32 Type "copyright", "credits" or "license" for more information. IDLE 0.8 -- press F1 for help >>> pwd Traceback (most recent call last): File "", line 1, in ? pwd NameError: name 'pwd' is not defined >>> dir >>> dir() ['__builtins__', '__doc__', '__name__'] ---{NP:} "Yes thank you.. But where am I?" >>> __name__ '__main__' ---{NP:} [goes off dilignetly and scours docs, books, websites, google and newgroups to eventually discover magic Python search incantation 'curdir'] >>> curdir Traceback (most recent call last): File "", line 1, in ? curdir NameError: name 'curdir' is not defined ---{NP:} [tries IDLE's find to locate 'curdir'] Searching 'curdir' in *.py ... ---{NP:} "This is ridiculous!!" [NP sensibly now opens google and enters: 'curdir python'] http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=curdir+python Eyeballing the result quickly #5 on the list look helpful: Home / Articles / Why I Like Python ... so I can do the same as above: import os, re htmlfiles = filter( lambda file: re.search("\.html$", file), os.listdir(os.curdir)) Some expressions in Python are ... opag.ca/articles/article_mike1.shtml - 26k - 18 Sep 2002 - Cached - Similar pages No hits. >>> os.listdir(os.curdir) Traceback (most recent call last): File "", line 1, in ? os.listdir(os.curdir) NameError: name 'os' is not defined >>> import os >>> os.curdir '.' ---{NP:} [laughs at this circular game but encouraged] >>> os.listdir(os.curdir) ['BACKUP', 'UNWISE.EXE', 'LICENSE.txt', 'README.txt', 'NEWS.txt', 'pycon.ico', 'pyc.ico', 'py.ico', 'python.exe', 'pythonw.exe', 'DLLs', 'w9xpopen.exe', 'libs', 'Lib', 'include', 'tcl', 'Tools', 'Doc', 'INSTALL.LOG', 'PythonCardPrototype-wininst.log', 'RemovePythonCardPrototype.exe', 'PythonCardPrototype', 'bsddb3', 'bsddb3-wininst.log', 'Removebsddb3.exe', 'StandaloneZODB-1.0', 'kviewer.exe', 'Jython_stuff'] ---{NP:} "I know I am close. There must be a method in here sonewhere to tell me where I am. Man, why do they have to make the easy things so HARD???" >>> dir(os) ['F_OK', 'O_APPEND', 'O_BINARY', 'O_CREAT', 'O_EXCL', 'O_RDONLY', 'O_RDWR', 'O_TEXT', 'O_TRUNC', 'O_WRONLY', 'P_DETACH', 'P_NOWAIT', 'P_NOWAITO', 'P_OVERLAY', 'P_WAIT', 'R_OK', 'TMP_MAX', 'UserDict', 'W_OK', 'X_OK', '_Environ', '__all__', '__builtins__', '__doc__', '__file__', '__name__', '_copy_reg', '_execvpe', '_exists', '_exit', '_get_exports_list', '_make_stat_result', '_make_statvfs_result', '_notfound', '_pickle_stat_result', '_pickle_statvfs_result', 'abort', 'access', 'altsep', 'chdir', 'chmod', 'close', 'curdir', 'defpath', 'dup', 'dup2', 'environ', 'error', 'execl', 'execle', 'execlp', 'execlpe', 'execv', 'execve', 'execvp', 'execvpe', 'extsep', 'fdopen', 'fstat', 'getcwd', 'getenv', 'getpid', 'i', 'isatty', 'linesep', 'listdir', 'lseek', 'lstat', 'makedirs', 'mkdir', 'name', 'open', 'pardir', 'path', 'pathsep', 'pipe', 'popen', 'popen2', 'popen3', 'popen4', 'putenv', 'read', 'remove', 'removedirs', 'rename', 'renames', 'rmdir', 'sep', 'spawnl', 'spawnle', 'spawnv', 'spawnve', 'startfile', 'stat', 'stat_result', 'statvfs_result', 'strerror', 'sys', 'system', 'tempnam', 'times', 'tmpfile', 'tmpnam', 'umask', 'unlink', 'unsetenv', 'utime', 'write'] ---{NP:} [tries out some of the 'os' methods until...] >>> os.getcwd >>> os.getcwd() 'C:\\Python22' ---{NP:} "Bingo!! Are they kidding - I have to load a frigging 'os' module every time just to find out where I am?? This can't be right. I must be doing something wrong." [ After this small sucess goes back the article http://opag.ca/articles/article_mike1.shtml ] for file in os.listdir(os.curdir): if file[-5:] == '.html': print "found an html file!" ---{NP:} "hmm ok that looks easy let me try!! >>> for file in os.listdir(os.curdir): print file BACKUP UNWISE.EXE LICENSE.txt README.txt NEWS.txt pycon.ico etc... ---{NP:} "Great now were cooking. Let's try the current directory:" >>> for file in os.listdir(os.getcwd): print file Traceback (most recent call last): File "", line 1, in ? for file in os.listdir(os.getcwd): TypeError: coercing to Unicode: need string or buffer, builtin_function_or_method found ---{NP:} "Alright, alright..how about this.." >>> for file in os.listdir(os.getcwd()): print file BACKUP UNWISE.EXE LICENSE.txt README.txt NEWS.txt etc... >>> leodir = 'c:\\program files\\leo\\' >>> for file in os.listdir(leodir): if file[-3:] == '.py': print file leoAtFile.py leoFrame.py leoCompare.py etc... ---{NP:} "Yesss finally:-) [meanwhile NP's friend opens a REBOL shell on the PC next to him...] REBOL/View 1.2.8.3.1 3-Aug-2002 >> dir ** Script Error: dir has no value ** Near: dir >> ? dir Found these words: change-dir function! Changes the active directory path. dir? function! Returns TRUE if a file or URL is a directory. dirize function! Returns a copy of the path turned into a directory... jdirs object! [pm hw ts trees jabber] list-dir function! Prints a multi-column sorted listing of a director... make-dir function! Creates the specified directory. No error if alrea... what-dir function! Prints the active directory path >> what-dir == %/C/rebol/view/ [..hysterical laughter fills the room..] Hell-o Novice Pythonistas ? --------------------------- While you debate the important and finer points of to built_in or not to built_in, I hope we all think a lot more seriously about what else should be readily __available__ and __understandable__ to Novices. IDLE = ['Interactive', 'Development', 'Learning', 'Environment'] ./Jason From lha2@columbia.edu Fri Sep 20 11:16:50 2002 From: lha2@columbia.edu (Lloyd Hugh Allen) Date: Fri, 20 Sep 2002 06:16:50 -0400 Subject: [Edu-sig] Top 5 All Time Novice Obstacles => #3 Where am I ? References: <20020920064401.4401.93650.Mailman@mail.python.org> Message-ID: <3D8AF592.E32EA5D8@mail.verizon.net> > 11. >>> os.lstat.__doc__ > SG: > Had a problem with help(os.lstat)? And you were expecting maybe? > > 12. >>> print os.lstat.__doc__ > SG: > Hey buddy you looking to lstat or are we just playing games here? The __doc__ attribute of a function is documented (hee hee) in the tutorial, section 4.7.5. Granted that the tutorial is a lot easier to understand for folks who already have one language under their belt. It is also described extensively in Guido's style guide , and it is stated that doc strings should actually be helpful. Somehow I found out about doc strings, even though I was a newbie once...assuming that folks are learning Python with access to the web, and that they are reading tutorials and documentation instead of typing random characters a la Shakespearian monkeys waiting for a Python port of Unreal Tournament to appear on their terminal, they should be able to find doc strings fairly quickly. I know they're one of the first features that I teach, when I teach Python each summer. From lha2@columbia.edu Fri Sep 20 11:21:34 2002 From: lha2@columbia.edu (Lloyd Hugh Allen) Date: Fri, 20 Sep 2002 06:21:34 -0400 Subject: [Edu-sig] re: novice error ImportError References: <20020920064401.4401.93650.Mailman@mail.python.org> Message-ID: <3D8AF6AE.B43FD0D8@mail.verizon.net> > >>> import leo > Traceback (most recent call last): > File "", line 1, in ? > import leo > ImportError: No module named leo If the module is opened and executed via f5 from IDLE, the path of its directory is added to the syspath. So (to take from an unquoted part of the message), if I run my helloworld.py the first time using this method, then later I'll be able to import (using >>> import foo) anything else that I wrote and kept in this directory. Yeah, doesn't help with leo. 'Course, Numeric, pygame, and others, have nice installers that add themselves to the os.path (at least, they run, and I didn't touch my os.path). From Jason Cunliffe" #3 Where am I ? References: <20020920064401.4401.93650.Mailman@mail.python.org> <3D8AF592.E32EA5D8@mail.verizon.net> Message-ID: <004101c26093$bf7881c0$6501a8c0@vaio> > Somehow I found out about doc strings, even though I was a newbie > once...assuming that folks are learning Python with access to the web, > and that they are reading tutorials and documentation instead of typing > random characters a la Shakespearian monkeys waiting for a Python port > of Unreal Tournament to appear on their terminal, they should be able to > find doc strings fairly quickly. I know they're one of the first > features that I teach, when I teach Python each summer. Lol//Yes.. I love Python doc strings. I think that along with keyword args and whitepace indentation they are the best things about Python, for beginners and thus everyone. I wish they were used more deeply, and in more clever ways by IDLE. REBOL has similar docstrings ideas. Just instering strings in the right places, before headers in functions etc activates them. I'eve been starting to go back over the on-line tutorials and books to see which ones have left these beginner holes/blindpots uncovered. Python has mostly excellent docs and resuorces. And the higher you go the better it gets in terms of community support. It's the first weekend espcially those who don't have great teachers, techy parents or access to bookstores. I hope people don't misunderstand my "Top 5" posts. I am trying to honestly remember and invoke the clash of absurd common sense when Novices meet a super-system like Python. I believe Python is mostly very friendly and suitable for Edu-Sig. Technically, culturally legally. But I do suspect everyone is way too smart experienced educated here to remember any longer what it feels like to start out and be confused and frustrated. Even browsing the Python installation is overwhelming - there's so much! That's not a complaint and cause for celebration. So how can Python be improved for first time programmers? I'd like to hear more about your own teaching experiences. ./Jason From guido@python.org Fri Sep 20 13:49:11 2002 From: guido@python.org (Guido van Rossum) Date: Fri, 20 Sep 2002 08:49:11 -0400 Subject: [Edu-sig] Fw: Python sequences by reference - how to make clear In-Reply-To: Your message of "Thu, 19 Sep 2002 15:53:26 PDT." <5.1.1.6.0.20020919151415.029c6ad0@pop.ptld.qwest.net> References: <200209192006.g8JK6ui05759@odiug.zope.com> <010e01c2601a$464a3600$9865fea9@arthur> <200209192030.g8JKUog06305@odiug.zope.com> <011801c2601e$ec56c4b0$9865fea9@arthur> <5.1.1.6.0.20020919151415.029c6ad0@pop.ptld.qwest.net> Message-ID: <200209201249.g8KCnBp05646@pcp02138704pcs.reston01.va.comcast.net> What Kirby describes can be had by doing >>> from copy import copy, deepcopy copy() nor deepcopy() is a built-in, because it is a potentially expensive operation, and I feel that its presence as a built-in would cause beginning and intermediate programmers to overuse it. --Guido van Rossum (home page: http://www.python.org/~guido/) From guido@python.org Fri Sep 20 13:51:53 2002 From: guido@python.org (Guido van Rossum) Date: Fri, 20 Sep 2002 08:51:53 -0400 Subject: [Edu-sig] Fw: Python sequences by reference - how to make clear In-Reply-To: Your message of "Fri, 20 Sep 2002 03:08:48 -0000." <200209200309.g8K3908U026992@ada.brynmawr.edu> References: <200209200309.g8K3908U026992@ada.brynmawr.edu> Message-ID: <200209201251.g8KCprj05658@pcp02138704pcs.reston01.va.comcast.net> > I would assume that copy() would be a deepcopy by default (as that > would be what new users would assume). So, that might suggest a > shallowcopy() method too. Deep copying is not very useful, as it usually copies way too much. If you focus all your examples on multi-dimensional arrays, yes, then you'd need deep copying to be the default. But I think that is a narrow-minded view on learning to program, based in the state of the art in the early '60s (when arrays were the only data structuring methodology available in programming languages). --Guido van Rossum (home page: http://www.python.org/~guido/) From guido@python.org Fri Sep 20 14:47:11 2002 From: guido@python.org (Guido van Rossum) Date: Fri, 20 Sep 2002 09:47:11 -0400 Subject: [Edu-sig] Top 5 All Time Novice Obstacles => #1 ImportError: No module named xyz In-Reply-To: Your message of "Thu, 19 Sep 2002 20:57:46 EDT." <001201c26040$bd23ab00$6501a8c0@vaio> References: <001201c26040$bd23ab00$6501a8c0@vaio> Message-ID: <200209201347.g8KDlBU06579@pcp02138704pcs.reston01.va.comcast.net> > Suggestion A. HELPFUL ERROR PROMPT > > Instead of > > >>> import helloworld > Traceback (most recent call last): > File "", line 1, in ? > import leo > ImportError: No module named helloworld > > How about > > >>> import helloworld > Traceback (most recent call last): > File "", line 1, in ? > import leo > ImportError: No module named helloworld > > *** Python needs to know where "helloworld" is located. > import sys > sys.path # Shows which directories Python knows to search and load from. > You must add the path where "helloworld" is located, then try import again > sys.path.append('C:\\path-to-hello=world\\') > > I am sure you can improve upon this help prompt. Python programmers > know perfectly well what to do. It in the tutorials and docs. But > why not serve it up for beginners. > A "novice-help-prompt-config.py" file could be bundled with Python > to allow people to control and modify it. For example a teacher > could add urls to docs, on-line courseware notes. Also localize the > paths advice better to reflect local operating system locations more > cleanly. I expect that even for novices (unless they type perfectly), this long message gets old quickly -- the much more common case surely is a typo in the module name. The solution you suggest above also isn't always right. More often than not, moving the file into the path is te better solution. There's also the issue that when the module is an extension, there's no .py file (a common newbie issue is frustration about not being able to find, e.g. "math.py" when "import math" fails). And it's possible that the path is entirely screwed up -- if "import math" doesn't work, your setup is hosed and it will take an expert to unhose it. Perhaps we could tweak IDLE to add a single line to the ImportError message, something like "type help('import') for help on importing modules" and the help section for the import keyword could contain a treatise on a variety of import issues. I'd also suggest that Leo could have installed its package in the python standard library directory rather than installing itself in a totally separate directory. > Suggestion B. ACTION ERROR PROMPT > > This version says don't just suggest, do something. > In other words run 'import sys' and 'sys.path'. > Then ask the user if Python should search the system for possible > locations of 'helloworld' > If Python finds any, return a visible command list and ask which one > to invoke, always using the official sys.path.append() syntax so > they can learn the syntax pattern quickly. Much too complicated. --Guido van Rossum (home page: http://www.python.org/~guido/) From guido@python.org Fri Sep 20 15:00:35 2002 From: guido@python.org (Guido van Rossum) Date: Fri, 20 Sep 2002 10:00:35 -0400 Subject: [Edu-sig] Top 5 All Time Novice Obstacles => #2 Helping help In-Reply-To: Your message of "Fri, 20 Sep 2002 00:47:15 EDT." <003301c26060$cb61b3e0$6501a8c0@vaio> References: <001201c26040$bd23ab00$6501a8c0@vaio> <003301c26060$cb61b3e0$6501a8c0@vaio> Message-ID: <200209201400.g8KE0Zk06679@pcp02138704pcs.reston01.va.comcast.net> > When Novice Pythonistas get to steps 5. and 8. above, surely Python > can help by jumping in with help(os.lstat)? I've tried to stay out of the artificial intelligence business. I think what you're asking for is a separate "newbie shell" that takes a *much* more careful look at what you're trying to do, and provides help accordingly. That would be a great project. But one or two tweaks to Python or IDLE ain't gonna do it. It *seems* simple on the surface -- until you realize that you get the same errors all the time for different reasons. --Guido van Rossum (home page: http://www.python.org/~guido/) From guido@python.org Fri Sep 20 15:07:59 2002 From: guido@python.org (Guido van Rossum) Date: Fri, 20 Sep 2002 10:07:59 -0400 Subject: [Edu-sig] Top 5 All Time Novice Obstacles => #3 Where am I ? In-Reply-To: Your message of "Fri, 20 Sep 2002 02:44:37 EDT." <004b01c26071$30a3b040$6501a8c0@vaio> References: <001201c26040$bd23ab00$6501a8c0@vaio> <003301c26060$cb61b3e0$6501a8c0@vaio> <004b01c26071$30a3b040$6501a8c0@vaio> Message-ID: <200209201407.g8KE7xo06717@pcp02138704pcs.reston01.va.comcast.net> > ---{NP:} "Bingo!! Are they kidding - I have to load a frigging 'os' module > every time just to find out where I am?? This can't be right. I must be doing > something wrong." It all depends. Your most frequent need may not be so common for most others. (Plus I would say that you seem to have more DOS or Unix experience than I expect from a typical newbie.) > >> ? dir > Found these words: > change-dir function! Changes the active directory path. > dir? function! Returns TRUE if a file or URL is a directory. > dirize function! Returns a copy of the path turned into a > directory... > jdirs object! [pm hw ts trees jabber] > list-dir function! Prints a multi-column sorted listing of a > director... > make-dir function! Creates the specified directory. No error if > alrea... > what-dir function! Prints the active directory path > >> what-dir > == %/C/rebol/view/ That's not a bad idea. --Guido van Rossum (home page: http://www.python.org/~guido/) From pobrien@orbtech.com Fri Sep 20 15:33:07 2002 From: pobrien@orbtech.com (Patrick K. O'Brien) Date: Fri, 20 Sep 2002 09:33:07 -0500 Subject: [Edu-sig] Top 5 All Time Novice Obstacles => #2 Helping help In-Reply-To: <200209201400.g8KE0Zk06679@pcp02138704pcs.reston01.va.comcast.net> Message-ID: [Guido van Rossum] > > > When Novice Pythonistas get to steps 5. and 8. above, surely Python > > can help by jumping in with help(os.lstat)? > > I've tried to stay out of the artificial intelligence business. I > think what you're asking for is a separate "newbie shell" that takes a > *much* more careful look at what you're trying to do, and provides > help accordingly. That would be a great project. But one or two > tweaks to Python or IDLE ain't gonna do it. It *seems* simple on the > surface -- until you realize that you get the same errors all the time > for different reasons. If I may toot my own horn, have any of you tried PyCrust? It's a Python shell that ships with wxPython. PyCrust will pop up a list of object properties after the dot operator, pop up a call tip window that displays the argument spec and docstring when you type the left paren for function and method calls (and class instantiation), has a namespace tree view in which you can drill down to explore any object in the current namespace, etc, etc. A text pane to the right of the namespace tree shows additional details for the item selected in the tree, such as the proper syntax for referencing the object, the object type, the object value and the source code for the object, if it is available. It's not artificial intelligence by any means, but it does leverage Python introspection to the max for people (like me) who like pointing and clicking and having all that information right in front of them. Pat -- Patrick K. O'Brien Orbtech ----------------------------------------------- "Your source for Python programming expertise." ----------------------------------------------- Web: http://www.orbtech.com/web/pobrien/ Blog: http://www.orbtech.com/blog/pobrien/ Wiki: http://www.orbtech.com/wiki/PatrickOBrien ----------------------------------------------- From ajs@ix.netcom.com Fri Sep 20 16:42:00 2002 From: ajs@ix.netcom.com (Arthur) Date: Fri, 20 Sep 2002 11:42:00 -0400 Subject: [Edu-sig] Fw: Python sequences by reference - how to make Message-ID: <01a101c260bc$53687cf0$9865fea9@arthur> Guido writes - >What Kirby describes can be had by doing > >>> from copy import copy, deepcopy Which is obviously why I can't come up with a code example for my position. If wel are willing to make that the answer there is clearly nothing to discuss. >copy() nor deepcopy() is a built-in, because it is a potentially >expensive operation, and I feel that its presence as a built-in would >cause beginning and intermediate programmers to overuse it. My only counter argument is that this decision was made when Python had much, much fewer very,very specialized libraries. The expectation/perception of what it means to import a library module has evolved to the point to where it is counter-intututive to expect to need to import functionality like that added by copy - IMO. But my argument is circular in some sense - because I am contending that copy represents core functionality, or more accurately, a core conceptual idea. I am emphasizing *that* - the conceptual clues that one is given by seeing copy as a built-in, and you are emphasizing other concerns. I understand that you are often in the trade-off business - and I guess there is no harm in having some disagreement as to where the trade-offs might fall at this particular stage of the game. Art From dblank@cs.brynmawr.edu Fri Sep 20 21:24:48 2002 From: dblank@cs.brynmawr.edu (Douglas S. Blank) Date: Fri, 20 Sep 2002 16:24:48 -0400 Subject: [Edu-sig] how to make clear: understand references References: <200209200309.g8K3908U026992@ada.brynmawr.edu> <200209201251.g8KCprj05658@pcp02138704pcs.reston01.va.comcast.net> Message-ID: <3D8B8410.3080307@cs.brynmawr.edu> Earlier, I spake: >>I would assume that copy() would be a deepcopy by default (as that >>would be what new users would assume). So, that might suggest a >>shallowcopy() method too. which prompted a certain Guido van Rossum to comment: > Deep copying is not very useful, as it usually copies way too much. Upon further reflection, I think I was wrong: the default should not always be a deep copy. Just think of copying a node from the middle of a tree--- you don't want to copy the whole subtree, just that node. But it does seem to be the right thing to do for arrays. > If you focus all your examples on multi-dimensional arrays, yes, then > you'd need deep copying to be the default. But I think that is a > narrow-minded view on learning to program, based in the state of the > art in the early '60s (when arrays were the only data structuring > methodology available in programming languages). I did give two examples of multi-dimensional arrays, but the issue, I believe, is with the operators, not the arrays. I had suggested: >>> a = [[0] * 5].copy() * 3 But, I now see that that doesn't fix the problem that I originally had, because, even a deepcopy doesn't help: >>> a = [deepcopy([0] * 6)] * 3 # or >>> a = deepcopy([[0] * 6]) * 3 >>> a[0][0] = 4 >>> a [[4, 0, 0, 0, 0, 0], [4, 0, 0, 0, 0, 0], [4, 0, 0, 0, 0, 0]] So now we see that this particular confusion won't (easily) go away with anything other than understanding where to draw those little boxes around objects and understanding references. -Doug > --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 -- Douglas S. Blank, Assistant Professor dblank@brynmawr.edu, (610)526-6501 Bryn Mawr College, Computer Science Program 101 North Merion Ave, Park Science Bld. Bryn Mawr, PA 19010 dangermouse.brynmawr.edu From ajs@ix.netcom.com Fri Sep 20 23:23:03 2002 From: ajs@ix.netcom.com (Arthur) Date: Fri, 20 Sep 2002 18:23:03 -0400 Subject: [Edu-sig] re: Python sequences by reference - how to make Message-ID: <021e01c260f4$77f18980$9865fea9@arthur> Guido had written - >Until you have introspected enough to come up with an example I do not consider your testimony enough to change the >language. I think that is fair too. Unfortunately for all concerned I do try to continue to introspect. And will continue to express what I am coming up. And note as a side comment that this (the Python world) is the only forum in which I ever elected to consistently and unabashedly make a spectacle of myself. And I'm not a kid. Maybe its something about being a fish out of water - or perhaps I can be kinder to myself and point to the peculiarities of the forum. Not that I am not having fun, BTW. And what I'm zenning up from the nether regions is something to the effect that the centrality of the concept of copy is centrality in the negative. It is difficult to understand, at the beginning, what one is doing when doing a=b. And one way to begin to understand what that is, is to understand what that is not. With no "copy" clearly on the scene with which to coontrast, that particular important distinction does not have the opportunity to emerge. As I piece it together. Art From urnerk@qwest.net Sat Sep 21 16:43:59 2002 From: urnerk@qwest.net (Kirby Urner) Date: Sat, 21 Sep 2002 08:43:59 -0700 Subject: [Edu-sig] Fw: Python sequences by reference - how to make In-Reply-To: <01a101c260bc$53687cf0$9865fea9@arthur> Message-ID: <5.1.1.6.0.20020921083941.03015850@pop.ptld.qwest.net> At 11:42 AM 9/20/2002 -0400, Art wrote: >My only counter argument is that this decision was made when Python had >much, much fewer very,very specialized libraries. The expectation/perception >of what it means to import a library module has evolved to the point to >where it is counter-intututive to expect to need to import functionality >like that added by copy - IMO. I dunno about this argument. Even 'math' (sin, cos etc.) is an import. >But my argument is circular in some sense - because I am contending that >copy represents core functionality, or more accurately, a core conceptual >idea. I think if the decision is to go with 'from copy import copy, deepcopy' then the workaround is to address copying for centrally in the tutorials. Copying might be a good segue into a subject heading like "...indeed, a lot of Python's functionality is tucked away in libraries, for example...". Python inherits from C in this respect, wherein even such basic stuff as file i/o is in libraries. Python is being 'liberal' vis-a-vis C in allowing 'open' as a built-in. Kirby From urnerk@qwest.net Sat Sep 21 16:51:31 2002 From: urnerk@qwest.net (Kirby Urner) Date: Sat, 21 Sep 2002 08:51:31 -0700 Subject: [Edu-sig] how to make clear: understand references In-Reply-To: <3D8B8410.3080307@cs.brynmawr.edu> References: <200209200309.g8K3908U026992@ada.brynmawr.edu> <200209201251.g8KCprj05658@pcp02138704pcs.reston01.va.comcast.net> Message-ID: <5.1.1.6.0.20020921084533.02416db0@pop.ptld.qwest.net> At 04:24 PM 9/20/2002 -0400, Douglas S. Blank wrote: >I did give two examples of multi-dimensional arrays, but the issue, >I believe, is with the operators, not the arrays. I had suggested: > > >>> a = [[0] * 5].copy() * 3 This wouldn't be conceptually right anyway, as you're getting the copy _before_ you replicate the thing three times -- then you replicate the very same copy. But it's at the replication stage that you want the copies. > >>> a = [deepcopy([0] * 6)] * 3 # or Same problem -- first you deepcopy, then you use * to replicate. What you need is: >>> a = a + deepcopy(a) + deepcopy(a) Kirby From urnerk@qwest.net Sat Sep 21 17:00:47 2002 From: urnerk@qwest.net (Kirby Urner) Date: Sat, 21 Sep 2002 09:00:47 -0700 Subject: [Edu-sig] Fw: Python sequences by reference - how to make In-Reply-To: <5.1.1.6.0.20020921083941.03015850@pop.ptld.qwest.net> References: <01a101c260bc$53687cf0$9865fea9@arthur> Message-ID: <5.1.1.6.0.20020921085301.030135f0@pop.ptld.qwest.net> > >I think if the decision is to go with 'from copy import copy, deepcopy' ^^^^^^^ stay with >then the workaround is to address copying for centrally in the tutorials. > ^^^^^^^^^^^^^ more centrally Since understanding the variablename -> object relationship is so central to Python, one could argue that hiding 'copy' in a library is a way to *ensure* newbies will keep stubbing their toe on this missing capability, until the relationship is "gotten". Because the distinction between copy and deepcopy requires a fairly clear appreciation of this same relationship, just including them in the builtins without a lot of explanation would be unlikely to address core confusions. I understand your side of it though: having them be there would encourage earlier, deeper investigation of the whole topic, and remind the user that a=b does *not* necessarily get that job done. Guido's school of thought says 'these are power tools that need to be on a higher shelf, so the casual tinkerer won't abuse them -- if you're not ready to tackle importing, you're not ready to start copying, let alone deepcopying.' Kirby From Jason Cunliffe" What I'd like help with is understanding the implications of loading libraries vs. built_ins vs. smarter IDLE prompts. For developers and students worknig at the Python shell, it is tedious and often often frustrating to have to load functionality repeatedly from libraries, ones which we feel should already be available. >From a script pov perspective, the assumption is rely 'assume nothing' so scripts should all start with a healthy block of import statements. Python does this well. 'Import' behaves transparently when a module is already loaded. Nice feature and thank you Python! But also introduces a little Novice gotcha we ALL learn on Day One Lesson#1: reload() I assume reload() is used 99% of the time at the shell and not in scripts.[?] If so, then that confirms slightly my point there are two use contexts we need to be discussing: A. people working interactively B. script and system defaults My recent Top 5' rants have been trying to focus more on use context A. [people] and how Python meets Novice users. But we are all novices about something, with expectations about Python behaves. So what strategy can be applied when Python boots and in the IDLE shell to handle these expectation better: - loading modules - visible feedback and prompts about them - ?? hope I am making sense ./Jason From ajs@ix.netcom.com Sun Sep 22 01:03:10 2002 From: ajs@ix.netcom.com (Arthur) Date: Sat, 21 Sep 2002 20:03:10 -0400 Subject: [Edu-sig] Python sequences by reference - how to make clear Message-ID: <028501c261cb$7636e680$9865fea9@arthur> Kirby writes - >I understand your side of it though: having them be there would >encourage earlier, deeper investigation of the whole >topic, and remind the user that a=b does *not* >necessarily get that job done. Actually my point is slightly, but importantly, different than that. The investigation will help the user understand what a=b means. By helping them undertand what a=b doesn't mean. One can argue whether facility with copy is or is not a core concept. I don't think one can argue the same as to a=b. >Guido's school of thought says 'these are power tools >that need to be on a higher shelf, so the casual tinkerer >won't abuse them if you're not ready to tackle importing, >you're not ready to start copying, let alone >deepcopying.' Guido's express it exactly as "copy() nor deepcopy() is a built-in, because it is a potentially expensive operation, and I feel that its presence as a built-in would cause beginning and intermediate programmers to overuse it." Premature optimization, perhaps? Art From guido@python.org Sun Sep 22 02:13:26 2002 From: guido@python.org (Guido van Rossum) Date: Sat, 21 Sep 2002 21:13:26 -0400 Subject: [Edu-sig] Fw: Python sequences by reference - how to make In-Reply-To: Your message of "Sat, 21 Sep 2002 12:36:07 EDT." <002e01c2618c$fc947a60$6501a8c0@vaio> References: <002e01c2618c$fc947a60$6501a8c0@vaio> Message-ID: <200209220113.g8M1DS927083@pcp02138704pcs.reston01.va.comcast.net> > What I'd like help with is understanding the implications of loading > libraries vs. built_ins vs. smarter IDLE prompts. > > For developers and students worknig at the Python shell, it is > tedious and often often frustrating to have to load functionality > repeatedly from libraries, ones which we feel should already be > available. Would a custom startup file that imports a bunch of stuff into your interactive prompt whenever you start IDLE work? All you need to do is set the shell environment variable PYTHONSTARTUP or IDLESTARTUP to point to a file that you want loaded. > From a script pov perspective, the assumption is rely 'assume > nothing' so scripts should all start with a healthy block of import > statements. Python does this well. 'Import' behaves transparently > when a module is already loaded. Nice feature and thank you Python! > > But also introduces a little Novice gotcha we ALL learn on Day One Lesson#1: > > reload() > > I assume reload() is used 99% of the time at the shell and not in > scripts.[?] I think it's closer to 100%. reload() is a crock -- it's just the best we've got. Except... The new version of IDLE that's now under development in the idlefork.sf.net project will address this better (hopefully) by providing a way to say "run my script in a fresh interpreter". > If so, then that confirms slightly my point there are > two use contexts we need to be discussing: > > A. people working interactively > B. script and system defaults > > My recent Top 5' rants have been trying to focus more on use context > A. [people] and how Python meets Novice users. But we are all > novices about something, with expectations about Python behaves. > > So what strategy can be applied when Python boots and in the IDLE > shell to handle these expectation better: > - loading modules > - visible feedback and prompts about them > - ?? Can you explain this more? --Guido van Rossum (home page: http://www.python.org/~guido/) From Jason Cunliffe" #3 Where am I ? References: <001201c26040$bd23ab00$6501a8c0@vaio> <003301c26060$cb61b3e0$6501a8c0@vaio> <004b01c26071$30a3b040$6501a8c0@vaio> <200209201407.g8KE7xo06717@pcp02138704pcs.reston01.va.comcast.net> Message-ID: <003c01c261e2$ab4c4240$6501a8c0@vaio> REBOL > > >> ? dir > > Found these words: > > change-dir function! Changes the active directory path. > > dir? function! Returns TRUE if a file or URL is a directory. > > dirize function! Returns a copy of the path turned into a > > directory... > > jdirs object! [pm hw ts trees jabber] > > list-dir function! Prints a multi-column sorted listing of a > > director... > > make-dir function! Creates the specified directory. No error if > > alrea... > > what-dir function! Prints the active directory path > > >> what-dir > > == %/C/rebol/view/ > > That's not a bad idea. Yes. The Python guts are all much more visible here: PYTHON >>> help(os) ./Jason From Jason Cunliffe" #2 Helping help References: Message-ID: <003d01c261e4$0ec4a000$6501a8c0@vaio> > It's not artificial intelligence by any means, but it does leverage Python > introspection to the max for people (like me) who like pointing and clicking > and having all that information right in front of them. Pat, thanks for the reminder about your 'PyCrust'. I'll be sure to check it out properly. Sounds good. Please can you tell me more about whose using it, what's popular and where you see it going? Also, what's the relationship between PyCrust and PythonCard? BTW, Most of the PyCrust features you mention are in the new FlashMX which has steadily been improving its internal ActionScript IDE. There's an XML config file developers can edit to enable and disable the pop-up prompts which appear for certain types of objects. The mechanism is exceedingly crude, it just parses a suffix string: _btn, _txt, etc.. But still very effective. Hard-core ActionScript gurus still tend to use all their favorite external editor, #include statements and keep the popup method 'hints' all turned off. But that's because they type like demons, and already know 85% of it well. One of the nicest new features is being able to open a context sensitive reference book. Just click the reference manual icon when the cursor is anywhere within an ActionScript word, and the reference page opens. For the rest of us, makes a great way to learn what's available. FlashMX [Flash6] is an now a very interesting place => a collision course melting/meeting pot for experienced programmers and artist.designers to learn programming. Many for the very first time. Macromedia have been doing a pretty good job lately at satisfying the needs of both. In another lifetime [I wish] MM would chose Python as its script language. And who knows, by version 10 they may open up the IDE and API to multiple languages. ActionScript is essentially JavaScript but with special methods and objects which control the Flash authoring environment, and of course the .SWF runtime players. So it has a good developer population and resources to feed off and attract. I quite like a lot of things about it, though language purists complain. The new thing since FlashMX rolled out this summer are drag'n'drop gui components. Simple things like smart buttons, videoplayers, Calendars, datagrids and much more. Its interesting I think from an Edu-Sig OOPS perspective to see the Flash designer and programmer culture grapple head-on with meta-programming. Writing reusable widgets which non-programmers can 'skin' the hell out of. That level of generalization comes at a price of complexity, size, speed, programmer effort and last but perhaps most essential documentation. This is like seeing Flash go from being a very young kid selling lemonade on the street in summer to getting a first job. There is just now an emerging market for commercial flash 'components'. MM bundles some basic ones, and flash developer community has been openly writing and sharing at a ferocious rate. Mostly as learning curve resource, but part of that effort is fueling the book business. We are just now seeing some serious OOPS titles for FlashMX ActionScript emerging. But now MM and a few others are promoting commercial package set with substantial docs etc. At $99 they want to test and motivate the market I think. I mention all this because Flash is continuing to motivate and introduce lots of people to object-oriented programming for the fist time. And for some its their first introduction with any kind of programming beyond perhaps some HTML. I do believe Flash is an excellent tool for introducing programming, and would hope see it in schools. Some day Python I hope will a programmable graphics engine which is as accessible and fun. Mostly they are skilled motion graphic students, artists and designers., many of who flunked math etc. [alternately embarrassed and proud of it, according to book bios and forums postings ]Visual geeks if you like. Now they are getting into programming ActionScript and I predict that soon many will arrive on Python's doorstep, a very different culture with different expectations. I imagine they will be also be glad to discover PyCrust. ./Jason From Jason Cunliffe" http://www.levitated.net/ ./Jason From Jason Cunliffe" http://www.bit-101.com/ From Jason Cunliffe" http://www.actionscript.cl/ From Jason Cunliffe" http://www.cnn.com/2002/TECH/fun.games/09/21/playstationhomework/index.html From guido@python.org Sun Sep 22 07:09:24 2002 From: guido@python.org (Guido van Rossum) Date: Sun, 22 Sep 2002 02:09:24 -0400 Subject: [Edu-sig] Top 5 All Time Novice Obstacles => #3 Where am I ? In-Reply-To: Your message of "Sat, 21 Sep 2002 22:49:27 EDT." <003c01c261e2$ab4c4240$6501a8c0@vaio> References: <001201c26040$bd23ab00$6501a8c0@vaio> <003301c26060$cb61b3e0$6501a8c0@vaio> <004b01c26071$30a3b040$6501a8c0@vaio> <200209201407.g8KE7xo06717@pcp02138704pcs.reston01.va.comcast.net> <003c01c261e2$ab4c4240$6501a8c0@vaio> Message-ID: <200209220609.g8M69P827583@pcp02138704pcs.reston01.va.comcast.net> > Yes. The Python guts are all much more visible here: > > PYTHON > >>> help(os) Sorry, I'm not sure what you mean (in fact I'm not even sure if that's good or bad!) Can you explain what you mean? --Guido van Rossum (home page: http://www.python.org/~guido/) From Jason Cunliffe" #3 Where am I ? References: <001201c26040$bd23ab00$6501a8c0@vaio> <003301c26060$cb61b3e0$6501a8c0@vaio> <004b01c26071$30a3b040$6501a8c0@vaio> <200209201407.g8KE7xo06717@pcp02138704pcs.reston01.va.comcast.net> <003c01c261e2$ab4c4240$6501a8c0@vaio> <200209220609.g8M69P827583@pcp02138704pcs.reston01.va.comcast.net> Message-ID: <000c01c2620b$87e3a2c0$6501a8c0@vaio> > > Yes. The Python guts are all much more visible here: > > > > PYTHON > > >>> help(os) > > Sorry, I'm not sure what you mean (in fact I'm not even sure if that's > good or bad!) Can you explain what you mean? Sorry. {mind-reading-not-included} My premise is that novices need more overview and quickly, than hackers. Or rather that hackers know well how to get the help they need ;-) Its the prime skillset [getting help => learning how to learn] So for contrast I showed a REBOL example, very crisp and upfront, which includes docstrings in clean formatted list group. It also does a dictionary search for similar words. [REBOL's "help" operator has shorter alias "?"] So in Rebol when you type help for a known word it will deliver just the docstrings for that word. Very to the point, like Python. But if you feed 'help' a short fuzzier string, or perhaps example a word which is a substring of several words known to the Rebol interpreter, it will go return all of those.. A more extreme example is to type one letter. >> ? d ;returns all the words which contain "d" >> ? dir ;returns all the words which contain "dir" >> >> ? what-dir USAGE: WHAT-DIR DESCRIPTION: Prints the active directory path WHAT-DIR is a function value. Like searching google there is quickly learned art in know when to widen and when to narrow the search based on fat returns. Python has just a massive amount of everything, including help. But is still dominantly by and for hackers, and brilliant ones too. That's what makes it so great, but not yet imho well tuned for true beginners as much as it could be. When you ask python for very specific help it delivers, but that may or may not be so helpful for the novice. I take your points well about AI and simple things being hard etc. And common sense is not.. I'll try to illustrate [my comments=A,B,C,etc]: >>> import os >>> os.curdir '.' >>> help(os.curdir) problem in - ValueError: Empty module name >>> help(os.curdir()) Traceback (most recent call last): File "", line 1, in ? help(os.curdir()) TypeError: 'str' object is not callable A. help is being very literal here, behaving correctly like the rest Python. But our student needs help not a lawyer! >>> os.listdir >>> help(os.listdir()) Traceback (most recent call last): File "", line 1, in ? help(os.listdir()) TypeError: listdir() takes exactly 1 argument (0 given) B. Ok better but help is getting routed to Error. Our student needs help. >>> help(os.listdir) Help on built-in function listdir: listdir(...) listdir(path) -> list_of_strings Return a list containing the names of the entries in the directory. path: path of directory to list The list is in arbitrary order. It does not include the special entries '.' and '..' even if they are present in the directory. C. Aaah yes thank you Python. Now it turns out that perhaps for our novice the best to get help one of the 'os' module functions in Python is to be __very__ general. KISS rules >>> help(os) D. wow. that's throwing the book at them, but it does provide a real overview within the fist screenful, AND it includes all the help for the functions our student wanted immediately. Arthur's reply to me implied that suffering until one has got the syntax down is a healthy part of learning Python. Yes and no. Let's consider this: >>> help Type help() for interactive help, or help(object) for help about object. >>> help(help) Help on instance of _Helper: Type help() for interactive help, or help(object) for help about object. >>> help() Welcome to Python 2.2! This is the online help utility. If this is your first time using Python, you should definitely check out the tutorial on the Internet at http://www.python.org/doc/tut/. Enter the name of any module, keyword, or topic to get help on writing Python programs and using Python modules. To quit this help utility and return to the interpreter, just type "quit". To get a list of available modules, keywords, or topics, type "modules", "keywords", or "topics". Each module also comes with a one-line summary of what it does; to list the modules whose summaries contain a given word such as "spam", type "modules spam". help> E. OK This is great a help prompt. But why not go straight to help() every time student uses help and trap the error messages above? Python always gives error messages. And fine they are for those who know what to make of them. But our students asked for help and surely does not need more errors. Later on yes, Error messages = help. help> listdir no Python documentation found for 'listdir' F. Damn! C'mon Python get smart please. Our student is looking for help on something called listdir. What can't find where it be? help> os.listdir Help on built-in function listdir in os: listdir(...) listdir(path) -> list_of_strings Return a list containing the names of the entries in the directory. path: path of directory to list The list is in arbitrary order. It does not include the special entries '.' and '..' even if they are present in the directory. G. Hooray. This is much better. Now student follows help> prompt's advice: help> modules Please wait a moment while I gather a list of all available modules... [huge list] H. Python "help()" is rich. But not very smart. Adding a find feature to it would make it much smarter without needing a heavy AI engine. Finding things is a large part of the battle and finding similar things is part of *that*. So giving someone all the modules or all of 'os' is good. And there are powerful 'find' tools in IDLE's menu. But they still tend to assume you know what you want. And beginners usually don't. If find,help and error functions could be all brought into sync/context better, I think Python would be much faster on-ramp for novices. It is a brilliant and friendly language mostly. So please don't take this for whining. We need to hear from young novice students and their teachers what helps them and what hangs them up early on. I am not a teacher and am working from just my own experiences and imagination. thanks ./Jason From guido@python.org Sun Sep 22 14:16:04 2002 From: guido@python.org (Guido van Rossum) Date: Sun, 22 Sep 2002 09:16:04 -0400 Subject: [Edu-sig] Top 5 All Time Novice Obstacles => #3 Where am I ? In-Reply-To: Your message of "Sun, 22 Sep 2002 03:41:57 EDT." <000c01c2620b$87e3a2c0$6501a8c0@vaio> References: <001201c26040$bd23ab00$6501a8c0@vaio> <003301c26060$cb61b3e0$6501a8c0@vaio> <004b01c26071$30a3b040$6501a8c0@vaio> <200209201407.g8KE7xo06717@pcp02138704pcs.reston01.va.comcast.net> <003c01c261e2$ab4c4240$6501a8c0@vaio> <200209220609.g8M69P827583@pcp02138704pcs.reston01.va.comcast.net> <000c01c2620b$87e3a2c0$6501a8c0@vaio> Message-ID: <200209221316.g8MDG5n03721@pcp02138704pcs.reston01.va.comcast.net> [Rebol help example omitted] Python's help is so much more modern than Rebol. :-) It has a GUI for this feature. Assuming you have Python 2.1.x or 2.2.x on Windows, go to the Start -> Programs -> Python x.x menu, and select "Module docs". Now type your search string in the text box and hit return. Double-click any of the resulting lines, and stand by for a webbrowser window to pop up. If you're on Linux/Unix (which automatically disqualifies you from being a "typical" newbie :-), type "pydoc -g" at the Unix shell. If that doesn't work, run the pydoc.py module as a script with the -g option. --Guido van Rossum (home page: http://www.python.org/~guido/) From ajs@ix.netcom.com Sun Sep 22 17:08:41 2002 From: ajs@ix.netcom.com (Arthur) Date: Sun, 22 Sep 2002 12:08:41 -0400 Subject: [Edu-sig] Top 5 All Time Novice Obstacles => #3 Where am I ? Message-ID: <02fd01c26252$53349330$9865fea9@arthur> Guido writes - >It has a GUI for this feature. Assuming you have Python 2.1.x or >2.2.x on Windows, go to the Start -> Programs -> Python x.x menu, and >select "Module docs". Now type your search string in the text box and >hit return. Double-click any of the resulting lines, and stand by for >a webbrowser window to pop up. For a refreshing change of pace I would like to agree with Guidio. It seems to me that Jason you come to the table with too many expectations (maybe from your Rebol experience) of how a help system "should" work, rather than spending the energy focusing on learning how the Python help system does work.. And I would agree with Guido, once that (minor) effort is made, all your expectations and more, from that point on, look like they will be met. And I would generalize that further. Have more confidence in Python. But fewer expectations coming in. Art From ajs@ix.netcom.com Sun Sep 22 18:02:00 2002 From: ajs@ix.netcom.com (Arthur) Date: Sun, 22 Sep 2002 13:02:00 -0400 Subject: [Edu-sig] Top 5 All Time Novice Obstacles => #3 Where am I ? Message-ID: <030a01c26259$dc4e5e10$9865fea9@arthur> Jason - One other thing I think worth commenting on. In looking at ActiveScript and Rebol, you are looking at projects of an essentially different kind than Python. As commercial products, they maintain a consistency of look, feel, approach which can be comforting and confidence inspiring. Python is an open source project with many people with their own approach and asthetic contributing to different aspects. Less "coherent" in some senses. I don't recall the details, but I think it is accurate to say that pydoc was built outside of the mainstream of Python development, by a volunteer developer. Guido made the decision to incorporate it into the distribution, but I believe, let it stand pretty much pat. (Somehow I feel he might correct me if I'm wrong) So it has maybe someone else's precise look and feel, rather than one uniformly "Pythonic" or "Guidoic". Could seem a little hodgepodge compared to a strictly commercial type product. But in the end it all seems to hang together quite well. But takes some getting used to, no doubt. Not that I mean to insult you about not having worked alot with open source type projects. But just don't know whether yu have made the connection here to what might be bugging you. Art From pobrien@orbtech.com Sun Sep 22 19:56:15 2002 From: pobrien@orbtech.com (Patrick K. O'Brien) Date: Sun, 22 Sep 2002 13:56:15 -0500 Subject: [Edu-sig] Top 5 All Time Novice Obstacles => #3 Where am I ? In-Reply-To: <200209221316.g8MDG5n03721@pcp02138704pcs.reston01.va.comcast.net> Message-ID: [Guido van Rossum] > > Python's help is so much more modern than Rebol. :-) > > It has a GUI for this feature. Assuming you have Python 2.1.x or > 2.2.x on Windows, go to the Start -> Programs -> Python x.x menu, and > select "Module docs". Now type your search string in the text box and > hit return. Double-click any of the resulting lines, and stand by for > a webbrowser window to pop up. Except that a search for "listdir" returned no results, and a search for "dir" returned a lot of results, but none that dealt with the dir() built-in. :-( Pat -- Patrick K. O'Brien Orbtech ----------------------------------------------- "Your source for Python programming expertise." ----------------------------------------------- Web: http://www.orbtech.com/web/pobrien/ Blog: http://www.orbtech.com/blog/pobrien/ Wiki: http://www.orbtech.com/wiki/PatrickOBrien ----------------------------------------------- From urnerk@qwest.net Sun Sep 22 20:37:43 2002 From: urnerk@qwest.net (Kirby Urner) Date: Sun, 22 Sep 2002 12:37:43 -0700 Subject: [Edu-sig] Top 5 All Time Novice Obstacles => #3 Where am I ? In-Reply-To: References: <200209221316.g8MDG5n03721@pcp02138704pcs.reston01.va.comcast.net> Message-ID: <5.1.1.6.0.20020922123448.02f8eab0@pop.ptld.qwest.net> At 01:56 PM 9/22/2002 -0500, you wrote: >[Guido van Rossum] > >Except that a search for "listdir" returned no results, and a search for >"dir" returned a lot of results, but none that dealt with the dir() >built-in. :-( > >Pat I searched on 'dir()' at the website and got: http://www.python.org/doc/1.5.1/tut/dir.html Found listdir on my hard drive by using the module index, looking under os. D:\Program Files\Python22\Doc\lib\os-file-dir.html Didn't seem so awfully inconvenient. Kirby From Jason Cunliffe" was {Re: [Edu-sig] Top 5 All Time Novice Obstacles => #3 Where am I ?} References: <001201c26040$bd23ab00$6501a8c0@vaio> <003301c26060$cb61b3e0$6501a8c0@vaio> <004b01c26071$30a3b040$6501a8c0@vaio> <200209201407.g8KE7xo06717@pcp02138704pcs.reston01.va.comcast.net> <003c01c261e2$ab4c4240$6501a8c0@vaio> <200209220609.g8M69P827583@pcp02138704pcs.reston01.va.comcast.net> <000c01c2620b$87e3a2c0$6501a8c0@vaio> <200209221316.g8MDG5n03721@pcp02138704pcs.reston01.va.comcast.net> Message-ID: <002f01c26272$c5eafa20$6501a8c0@vaio> > It has a GUI for this feature. Assuming you have Python 2.1.x or > 2.2.x on Windows, go to the Start -> Programs -> Python x.x menu, and > select "Module docs". Now type your search string in the text box and > hit return. Double-click any of the resulting lines, and stand by for > a webbrowser window to pop up. Well right now I am happily shocked, and shamed of course, because I did not know about the new module docs stuff which came in with 2.1. So thank you very much. I rebuilt my machnines recently and did full fresh updates & installs of many softwares, including Python to version 2.2 As I said, Python is an embarassement of riches. What a treasure trove to discover on http: port 7464! A little ironic though the interactive browsable module docs do not yet appear to bare not yet refernced by help(). I really would like to hear from anyone trying to teach Python to young students begining programming what their esxpeiences and opinots are. I am not complaining about Python and its resorces. It's fabulous. I recommend it all the time. I continue to question how well tuned it is to absolute and/or young beginners, a group unfortunately not present yet in this discussion. Let' steer this a different way.. http://www.python.org/doc/essays/cp4e.html [1999 version] Relative to your original CP4E grant proposal where you think Python stands now? If we were writing a CP4E-2002 proposal what would be the key points? ./Jason From urnerk@qwest.net Sun Sep 22 21:07:20 2002 From: urnerk@qwest.net (Kirby Urner) Date: Sun, 22 Sep 2002 13:07:20 -0700 Subject: [Edu-sig] Re: Module docs module (Tk utility) In-Reply-To: <200209221316.g8MDG5n03721@pcp02138704pcs.reston01.va.comca st.net> References: <001201c26040$bd23ab00$6501a8c0@vaio> <003301c26060$cb61b3e0$6501a8c0@vaio> <004b01c26071$30a3b040$6501a8c0@vaio> <200209201407.g8KE7xo06717@pcp02138704pcs.reston01.va.comcast.net> <003c01c261e2$ab4c4240$6501a8c0@vaio> <200209220609.g8M69P827583@pcp02138704pcs.reston01.va.comcast.net> <000c01c2620b$87e3a2c0$6501a8c0@vaio> Message-ID: <5.1.1.6.0.20020922125052.02f7d180@pop.ptld.qwest.net> At 09:16 AM 9/22/2002 -0400, you wrote: >[Rebol help example omitted] > >Python's help is so much more modern than Rebol. :-) > >It has a GUI for this feature. Assuming you have Python 2.1.x or >2.2.x on Windows, go to the Start -> Programs -> Python x.x menu, and >select "Module docs". Now type your search string in the text box and >hit return. Double-click any of the resulting lines, and stand by for >a webbrowser window to pop up. Took awhile to get this working -- old pydoc.pyw in same directory was messing it up, maybe left over from a previous install. pydocgui.pyw needs to load the "real" pydoc.py, not this imposter (which in turn loaded the real one, but too late -- no gui() attribute in the first one). Once I got it working, I searched on dir() and got nothing. Same with listdir, listdir(), os.listdir() etc. Opening the browser from this Tk utility (button), and getting the pink, white and blue view of my own hard drive was a hoot. Getting the "browser's eye view" of my very own modules was *really* fun. I'd been entirely oblivious of this feature up until now. Thanks Guido. Kirby From ajs@ix.netcom.com Sun Sep 22 22:14:23 2002 From: ajs@ix.netcom.com (Arthur) Date: Sun, 22 Sep 2002 17:14:23 -0400 Subject: [Edu-sig] re: CP4E-2002 Message-ID: <037601c2627f$00277630$9865fea9@arthur> Jason asks - >Relative to your original CP4E grant proposal where you think Python stands now? >If we were writing a CP4E-2002 proposal what would be the key points? I realize that you question is to Guido and I am quite sure I am not him. But I am in a *very* talkative mood today. What I would hope Guido might do is one of two things. Withdraw the proposal. There is simply no evidence of which I am aware that children have the cognitive capacity to do anything that is properly called programming - depending of course, and this is the key to it all, on how one defines the term programming and who one considers a child. Under my definitions, we have a no go. I certainly do not blame that reality on Guido. But nor do I expect him to have the capacity to change it. Else, Define the terms carefully. What do we mean by "programming" when we are talking about what it is that we hope to be able to expose to children. What Guido and Tim do? Obviously not. What I do? I humbly suggest not. What my son did at 7 or 8 with his more education video games? SimCity, e.g. Maybe. In which case there is *lots* going on out there, and it is presumptous to think that Python is bringing anything radically new to the table. So to me the question has always been moving clearly past semantics, to a clear definiton of terms and expectations.Don't think that happened very well the first time around. Art From Jason Cunliffe" #3 Where am I ? References: <030a01c26259$dc4e5e10$9865fea9@arthur> Message-ID: <003d01c26280$743ebdc0$6501a8c0@vaio> > In looking at ActiveScript and Rebol, you are looking at projects of an ^^^^^^ ActionScript > essentially different kind than Python. As commercial products, they > maintain a consistency of look, feel, approach which can be comforting and > confidence inspiring. hmmm... Python is incredibly consistent. Almost all the docs follow same style. Error messages are untiringly consistent in tone and detail. FlashMx and Rebol both have big problems. The value of the exercise I suggest is in learning from the good ideas, wherever they lie and asking where they benefit Python and vice versa. And if so, how to achieved that efficiently, using avaialable paradigms and features. Rebol is proprietary, and does not benefit from Python's wonderful openSource license or its vast community. As you can imagine this is a topic of frequent heated debate, because Rebol developers want to see this charming and unique langauge thrive. No-one works in a vaccum - they know what alternatives exist. REBOL is developed by a small private company team at Rebol Technologies, under the direction of the talented Carl Sassenrath. Core parts of Rebol are available free, including the basic /View GUI extension. Others are subject to licensing/royalty contracts. It runs over approx. 40 operating systems, has a tiny imprint, and is perhaps the simplest fastest installation I've ever seen. Some aspects of Rebol make it extraordinarily friendly to beginners. Ironically, not because of the published documentation [which painfully lacks and lags]. It is the ease and simplicity of many ideas and design decisions in Rebol, which help to make it fast fun powerful. In the US it is pretty much unknown. To my knowledge now one in Edu-Sig world is doign anything with it. It's a shame. I hear that in France, univsersities and researchers like it. Rebol has great ideas and is full of fascinating potential, but currently lacks either the commercial support it needs, or preferably the momentum of a strong openSource community like Python. Not withstanding all this, it rests with Python as a windeful modern Edu-Sig language. Strange interacial child of FORTH, LISP, and LOGO. Try it and see.. Flash has gone though constant upheaval since I first encountered it in 1996. Across the latest range of the 'MX' products, Macromedia has tried to present a consistent UI. In geneneral they mave made very good improvements over the past 18 months, responding to the large, and loud, complaints from experienced programmers who, at first reluctantly, were obliged to work with these tools. At the same time, many non-programmers intitally complained that suddenly everything had gotten too complex and 'geeky'. I am happy to report that phase is over, and now programming in FlashMX is somthing people really want to learn. Which has fuelled the rather remarkable phenomenon of expensive highly illustrated programming books about it. Approx each month there is a new one! Again and again there signs that a new kind of programming [scripting ]culture is emerging. People are falling backweards frmo Flash into needing, wanting to know how to develop basic Math and trig skills. A strange 'indie' math programming folklore is evident across the Internet in Flash forums. For example often initially driven by a desire to render ciruclar movements, flash artists have to re-discover basic geometry [Euclid] and trig. To create smooth movements they start re-inventing rudimentary calculus.Beuae flash has instrinsci sequence and time-motion engine, it makes a rich platform to explore proces, dynamics and calculus. Many of these artists are not going back to shool. They missed crucial lessons becuase they did not understand it or appreciate its usefulness at the time. Now they are getting it. Most them probably do not *yet* know about Python, or what it can do for them. I'll stick my neck out and say that there is a generation is in this predicament right now. I think that is very relevant to Edu-Sig. > Not that I mean to insult you about not having worked alot with open source > type projects. But just don't know whether yu have made the connection here > to what might be bugging you. As I hope I've made clear, no that's not what is bugging me. I love and use lots of open source tools. I prefer them by and large. I want to see this one learn well from the other. Do we agree the goal is to develop programming skills in everyone and from a young age? And that visual arts, music, media and literature have an important role to play in that? I am interested in the continuum of play => design => programming. Interactive visual geometry included. The great news is Python is also being adopted as API scripting platform for sophisticated creative media arts software. Including professional and commercial ones with big price tags. But not only them. That's helpful because it widens the culture, [and bringing with it clashes too, and crazy people like you and me.] Not yet filtered down for novices and young children. Its a challenge.. ./Jason From Jason Cunliffe" #3 Where am I ? References: <02fd01c26252$53349330$9865fea9@arthur> Message-ID: <005e01c26283$9f76dc40$6501a8c0@vaio> > For a refreshing change of pace I would like to agree with Guidio. It seems .. I am so glad. My rants then have not been totally in vain ;-) > to me that Jason you come to the table with too many expectations (maybe > from your Rebol experience) of how a help system "should" work, rather than > spending the energy focusing on learning how the Python help system does > work.. And I would agree with Guido, once that (minor) effort is Yes a good point. But people _do_ come with other expectations and habits. Some of them quite good ones too. I am actively learning Actionscript[MX], REBOL, Python, CGI and XSLT at the moment on Windows and Linux, trying stuff out daily on a Win98se laptop and 3 remote servers. In addtion to scripting work, I use easily half a dozen multimedia apps daily. Philosphically yours is good advice. Culturally, technically, I have chosen to embrace this diversity, or else I shold focus strongly on one, such as Python. I agree if I did, that I might learn faster and develop deeper skills in it. But my chosen path is "multi" - "media" and how to connect ideas and techniques from different sources. > made, all your expectations and more, from that point on, look like they > will be met. I am sorry. I flogged the horse too long, giving the unbalanced impression it was about me, becuae I wanted to offer subjecitive examples from the Python prompt. Not easy. Mostly because we lack better feedback from others [novices and teachers] > And I would generalize that further. Have more confidence in Python. But > fewer expectations coming in. I do... and yes it's good advice at any time of day! Happy Equinox and Harvest full moon to you all thanks ./Jason From guido@python.org Mon Sep 23 03:30:22 2002 From: guido@python.org (Guido van Rossum) Date: Sun, 22 Sep 2002 22:30:22 -0400 Subject: [Edu-sig] Top 5 All Time Novice Obstacles => #3 Where am I ? In-Reply-To: Your message of "Sun, 22 Sep 2002 17:38:55 EDT." <003d01c26280$743ebdc0$6501a8c0@vaio> References: <030a01c26259$dc4e5e10$9865fea9@arthur> <003d01c26280$743ebdc0$6501a8c0@vaio> Message-ID: <200209230230.g8N2UMf04854@pcp02138704pcs.reston01.va.comcast.net> On Rebol (which to my ears rhymes more with Cobol than with rebel :-), I've not looked much at it personally, but I trust a close colleague who has, and who finds it hard to use because the parser cannot know the end of a function's parameter list -- that's only known at run time, once the function is called. Sounds like dead on arrival to me, as far as language design goes. So if we want to learn from Rebol, we must try to learn from other ideas in it, not from the core language design. Flash: Around 1996 I was approached by Macromedia to become their director of language design. I declined, for a number of personal reasons, and because I didn't think I would be able to steer them sufficiently far away from where they were at the time. Since then, it appears that they have adopted Javascript; they could've done worse. Javascript shares some decent concepts with Python, in a more traditional syntax. (I think part of this may be due to Jim Roskind, who was at Netscape at the time that JS was developed, but was an early Python adopter at Infoseek before then.) I'd like to add that Flash succeeded where Java applets have failed. --Guido van Rossum (home page: http://www.python.org/~guido/) From guido@python.org Mon Sep 23 03:33:52 2002 From: guido@python.org (Guido van Rossum) Date: Sun, 22 Sep 2002 22:33:52 -0400 Subject: [Edu-sig] re: CP4E-2002 In-Reply-To: Your message of "Sun, 22 Sep 2002 17:14:23 EDT." <037601c2627f$00277630$9865fea9@arthur> References: <037601c2627f$00277630$9865fea9@arthur> Message-ID: <200209230233.g8N2Xqc04869@pcp02138704pcs.reston01.va.comcast.net> Art, have you actually *read* the CP4E proposal? Or are you basing your rejection still on the article I wrote for LJ? I am not so naive to expect that most children of 7-8 years old can learn to program -- though there definitely have been unusually talented children that young who *have* used Python (and everything else from Basic to assembler) successfully to create what can only be called computer programs. --Guido van Rossum (home page: http://www.python.org/~guido/) From guido@python.org Mon Sep 23 03:38:01 2002 From: guido@python.org (Guido van Rossum) Date: Sun, 22 Sep 2002 22:38:01 -0400 Subject: CP4E-2002 => was {Re: [Edu-sig] Top 5 All Time Novice Obstacles => #3 Where am I ?} In-Reply-To: Your message of "Sun, 22 Sep 2002 16:01:00 EDT." <002f01c26272$c5eafa20$6501a8c0@vaio> References: <001201c26040$bd23ab00$6501a8c0@vaio> <003301c26060$cb61b3e0$6501a8c0@vaio> <004b01c26071$30a3b040$6501a8c0@vaio> <200209201407.g8KE7xo06717@pcp02138704pcs.reston01.va.comcast.net> <003c01c261e2$ab4c4240$6501a8c0@vaio> <200209220609.g8M69P827583@pcp02138704pcs.reston01.va.comcast.net> <000c01c2620b$87e3a2c0$6501a8c0@vaio> <200209221316.g8MDG5n03721@pcp02138704pcs.reston01.va.comcast.net> <002f01c26272$c5eafa20$6501a8c0@vaio> Message-ID: <200209230238.g8N2c1i04885@pcp02138704pcs.reston01.va.comcast.net> > Relative to your original CP4E grant proposal where you think Python > stands now? Python has a long way to go -- but of the "real life" programming languages (from Java to Scheme) it is still the best positioned to succeed as a "first language". > If we were writing a CP4E-2002 proposal what would be the key > points? A proposal never stands in a vacuum -- it depends on the agenda of the funding organization to which the proposal is trying to sell its ideas, and on the interests of those who want to be funded. I wish I could say more, but I'm several 100s of emails behind, and since I am in no position to start writing such a funding proposal any time soon, I'll decline to answer further. --Guido van Rossum (home page: http://www.python.org/~guido/) From Jason Cunliffe" http://news.bbc.co.uk/2/hi/technology/2270648.stm From guido@python.org Mon Sep 23 04:42:54 2002 From: guido@python.org (Guido van Rossum) Date: Sun, 22 Sep 2002 23:42:54 -0400 Subject: [Edu-sig] how to make clear: understand references In-Reply-To: Your message of "Fri, 20 Sep 2002 16:24:48 EDT." <3D8B8410.3080307@cs.brynmawr.edu> References: <200209200309.g8K3908U026992@ada.brynmawr.edu> <200209201251.g8KCprj05658@pcp02138704pcs.reston01.va.comcast.net> <3D8B8410.3080307@cs.brynmawr.edu> Message-ID: <200209230342.g8N3guQ05192@pcp02138704pcs.reston01.va.comcast.net> > > If you focus all your examples on multi-dimensional arrays, yes, then > > you'd need deep copying to be the default. But I think that is a > > narrow-minded view on learning to program, based in the state of the > > art in the early '60s (when arrays were the only data structuring > > methodology available in programming languages). > > I did give two examples of multi-dimensional arrays, but the issue, I > believe, is with the operators, not the arrays. I had suggested: > > >>> a = [[0] * 5].copy() * 3 > > But, I now see that that doesn't fix the problem that I originally had, > because, even a deepcopy doesn't help: > > >>> a = [deepcopy([0] * 6)] * 3 # or > >>> a = deepcopy([[0] * 6]) * 3 > >>> a[0][0] = 4 > >>> a > [[4, 0, 0, 0, 0, 0], [4, 0, 0, 0, 0, 0], [4, 0, 0, 0, 0, 0]] > > So now we see that this particular confusion won't (easily) go away with > anything other than understanding where to draw those little boxes > around objects and understanding references. Noticing that the problem is with the * operators is helpful. But it is still a problem with lists because it is the list type's multiplication operator. I really don't want the sequence * to make copies of the items that are repeated; that would defeat the OO nature of lists. The solution is indeed to recognize that [[0]*m]*n is not the right way to create an n*m array. You'll have to write a helper function, e.g.: def ndim(n, *args): if not args: return [0]*n A = [] for i in range(n): A.append(ndim(*args)) return A --Guido van Rossum (home page: http://www.python.org/~guido/) From ajs@ix.netcom.com Mon Sep 23 05:21:19 2002 From: ajs@ix.netcom.com (Arthur) Date: Mon, 23 Sep 2002 00:21:19 -0400 Subject: [Edu-sig] re: CP4E-2002 References: <037601c2627f$00277630$9865fea9@arthur> <200209230233.g8N2Xqc04869@pcp02138704pcs.reston01.va.comcast.net> Message-ID: <000601c262b8$acebbc30$9865fea9@arthur> > Art, have you actually *read* the CP4E proposal? Or are you basing > your rejection still on the article I wrote for LJ? Certainly yes. though I haven't reread it recently, and I can't say its fresh in specifcs. > > I am not so naive to expect that most children of 7-8 years old can > learn to program -- though there definitely have been unusually > talented children that young who *have* used Python (and everything > else from Basic to assembler) successfully to create what can only be > called computer programs. All I'm lobbying for really is some precision in language (and that request coming from someone yet to get through a three line newsgroup post without a misspelling). A newbie in discussion is anyone from an MIT grad with six languages under his belt looking at Python as a 7th, to a 7th grader who comes to Python as a typical 7th grader. A non-progammer is either a Phd physicist working with Python at the frontiers of science doing, say, molecular modeling, to back to our 7th grader. "Programming" is I don't what, depending on who is using the word, in what context, for what effect. I think *that* has been the source of confusion, misunderstanding, and a few blow-ups along the way. All I am pleading for is some clearer definition of terms, at least when you or others or I are discussing, for example, a language change possibility addressing, for example, the needs of newbies. The MIT grad, or the 7th grader? If we are talking about non-programmers - are they content to be non-progammers? It they are, I make the suggestion we be content to let them stay non-progammers. You, it seems to me, have enough to do to worry about with folks who *want* to understand programming, are willing to work at it, and are looking for a way in. Again, the point being the semantics have been all over the place, and it has been hard to acutally *discuss* much of anything in this area, as far as I am concerned. Other than that - we are actually in agreement about a lot. Obviously, for example, I agree with your statement that Python is wonderfully configured as a first language (except for this damn problem of having to import copy :) ). We may disagree as to when it is realistic to introduce it, but there I am really just pulling a gut opinion out of my posterior - which happens, BTW, to be where my Zen intuition hangs out.. Art From glingl@aon.at Mon Sep 23 11:30:24 2002 From: glingl@aon.at (Gregor Lingl) Date: Mon, 23 Sep 2002 12:30:24 +0200 Subject: [Edu-sig] re: CP4E-2002 References: <037601c2627f$00277630$9865fea9@arthur> <200209230233.g8N2Xqc04869@pcp02138704pcs.reston01.va.comcast.net> <000601c262b8$acebbc30$9865fea9@arthur> Message-ID: <3D8EED40.5030300@aon.at> I' followin your discussion with great interest. Unfortunately my English is not good enough to contribute to your discussion in an approriate way. Nevertheless I'll try to put here some questions and some remarks. > > >>I am not so naive to expect that most children of 7-8 years old can >>learn to program -- though there definitely have been unusually >>talented children that young who *have* used Python (and everything >>else from Basic to assembler) successfully to create what can only be >>called computer programs. >> >> >... >A newbie in discussion is anyone from an MIT grad with six languages under >his belt looking at Python as a >7th, to a 7th grader who comes to Python as a typical 7th grader. A >non-progammer is either a Phd physicist >working with Python at the frontiers of science doing, say, molecular >modeling, to back to our 7th grader. "Programming" is I don't what, >depending on who is using the word, in what context, for what effect. > As a teacher I'm very concerned about this question, which for me is a practical and not a philosophical one. (Doing abstraction) I' like to say that programming is doing abstaction in pracitice and putting it to work on a machine. Learning how to do this ist furthered by an environment, which provides the possibility to experiment with the material you work with. (In the case of Python this can be done with the interactive interpreter). Would you agree, that this is true for the 7th grader as well as the Phd physicist? >I think *that* has been the source of confusion, misunderstanding, and a few >blow-ups along the way. All I am pleading for is some clearer definition of >terms, at least when you or others or I are discussing, for example, a >language change possibility addressing, for example, the needs of newbies. >The MIT grad, or the 7th grader? > Inerestingly it was (and is?) the MIT , which showed us that teaching how to program can be done in the same *spirit* for quite different sort of students addressed. I refer to Seymout Paperts Children, Mindstorms an Computers and to Abelson/Sussmanns Structure and Interpretation of Computer Programs. In some sense this was (is?) the sprit of lisp. I wonder why Paperts approach with turtle-graphics doesn't play a more prominent role in these discussions nowadays. (In my opinion it could be fruitful to integrate it better in efforts using Python in education.) In my experience LOGO suffered from the drawback, that it had a *very* high step in the learning curve, when going ahead from turtle graphics to list processing. There are several reasons for this, one being the fact, that lists in LOGO are the only compound data structure, another one that recursion is *essentially* the only way of control of program flow - how "natural" it is ever considered to be ... So LOGO - as far as I see it now - is a somewhat fundamentalistic language covered whith some sytactic sugar (which in fact spoiles the dish when used in large projects ... ) . So what to do? Go back to scheme (- which for me is the most beautiful programming language) ? In this respect Python offers a wonderful alternative. In contrast to scheme it is a very pragmatic language, which is imo one reason why it is so wonderfully appropriate for learning how to program - regardless of why you have to do it, "in what context, for what effect." Another reason is, that it offers a gentle approach to objects. In this respect I consider it to be more modern than the languages mentioned above. Introducing the concept of objects (of course built-in objects like strings and nubers first) and their names *from the beginning*, - accompanied by a discussion of the concept of mutability - will even prevent the process of copying lists to turn into a nearly unsurpassable problem. Or - if you have an object fritz, then build [fritz, fritz, fritz] and make fritz.turn_angry(), would you doubt, which one gets angry ;-). And this approach will also allow you to go a smooth path up to constructing your own objects. Regardless of how you see this, there remains much to do to bring Python to the schools. ( It certainly was not by accident, that the announced educational section at EuroPython was cancelled?) It would certainly be useful to discuss ways how this could be accomplished in this forum. I for my part, besides doing some courses for teachers here in Vienna, I am involved in the process of writing a textbook about programming with Python for Kids, in German. Hope to give it a push here, this way. Regards Gregor >.... > >Other than that - we are actually in agreement about a lot. Obviously, for >example, I agree with your statement that Python is wonderfully configured >as a first language (except for this damn problem of having to import copy >:) ). > >We may disagree as to when it is realistic to introduce it, but there I am >really just pulling a gut opinion out of my posterior - which happens, BTW, >to be where my Zen intuition hangs out.. > >Art > > >_______________________________________________ >Edu-sig mailing list >Edu-sig@python.org >http://mail.python.org/mailman/listinfo/edu-sig > > > > From p.kent@mail.com Mon Sep 23 11:43:56 2002 From: p.kent@mail.com (Phillip Kent) Date: Mon, 23 Sep 2002 11:43:56 +0100 Subject: [Edu-sig] re: CP4E-2002 Message-ID: <5.1.0.14.2.20020923112922.00a454b0@pop1.mail.com> >To: Arthur >cc: edu-sig@python.org >Subject: Re: [Edu-sig] re: CP4E-2002 >From: Guido van Rossum >Date: Sun, 22 Sep 2002 22:33:52 -0400 > >Art, have you actually *read* the CP4E proposal? Or are you basing >your rejection still on the article I wrote for LJ? > >I am not so naive to expect that most children of 7-8 years old can >learn to program -- though there definitely have been unusually >talented children that young who *have* used Python (and everything >else from Basic to assembler) successfully to create what can only be >called computer programs. > >--Guido van Rossum (home page: http://www.python.org/~guido/) I've haven't been reading this thread in detail - but if anyone is interested in the extent to which young children can learn to program, I recommend checking out a project by colleagues of mine, "Playground", which was precisely aimed at investigating what 7-8 year old children could learn in a "visual programming" environment (ToonTalk - www.toontalk.com ) - www.ioe.ac.uk/playground (The web site is a bit neglected, since the project is finished - but email them for more details) Piaget is often wheeled out in arguments like this to "demonstrate" that children cannot access formal reasoning until they achieve the "formal stage" (around 12 years old). However, I think the case against Piaget is pretty conclusive now (besides, Piaget is "out" in educational theory and we're all supposed to "into" Vygotsky nowadays). An old, but very very good argument for why computers change mental performance is "Mindstorms" by Seymour Papert (1980). And more recently, "Changing Minds" by Andrea diSessa (MIT Press, 2000). - Phillip ++++++ Dr Phillip Kent, London, UK mathematics education technology research p.kent@mail.com mobile: 07950 952034 ++++++ From Jason Cunliffe" Message-ID: <001a01c262f8$8325cfe0$6501a8c0@vaio> For what its worth, I do not doubt for a second that young children can 'program'. I believe we will later look back in astonishment at these early days when it was even questioned. Why am I so sure? Because from birth we learn at a phenomenal rate. We are seemingly hard- and soft-wired for *Language*. What biology left out, the momentum of living and our environment takes care of. Children [we all of us] program all the time. This is often called 'play'. And now we have new digital 'toys and games' like computers and Python. We have long ways to go in making them really suitable for children. Partly because of the chosen forms, functions, and design principle they manifest. But also in large measure simply because of how we use, view, present and teach them ourselves. How many would agree that toughest problems of widespread 'computational literacy' is lack of good experienced teachers and parents, (in societies that can afford it)? Compounded by educational inertia, conservatism, ignorance and fear. It is pretty safe so say that everyone here is witness to being the first generation who had these tools...um\ 'toys', including global internet. Perhaps the second generation to experience from birth and environment of global tele-communications [phone Radio TV]. The kids being born right now are entering a veuy different landscape. What do you suppose will be the jot topic of discussion in 25 years time? If 'memetic' writers like Susan Blackmore are on the right track, then 'copying' is a fundamental part who we are, and we we do. Over the course of long biological evolution as a species, through social cultural changes, and within each individual lifetime. http://www.susanblackmore.co.uk/mmsynop.html How we approach, teach, and design the next generation of computer-based programming tools will be very different. Becuause, in part the assumptions of early learning of that generation will be shaped by differnt environment. But in memetic terms, it will take several generation for the changes to deeply take root. While at the same time, we are part of the phenomenal speed with which ideas and 'memes' can travel. ...Ask any child who can 'program' the VCR which his parents cannot what the problem is? Or the teenagers in Asia typing with one thumb at lightening speed on their mobile phones..? ./Jason From guido@python.org Mon Sep 23 13:16:46 2002 From: guido@python.org (Guido van Rossum) Date: Mon, 23 Sep 2002 08:16:46 -0400 Subject: [Edu-sig] re: CP4E-2002 In-Reply-To: Your message of "Mon, 23 Sep 2002 00:21:19 EDT." <000601c262b8$acebbc30$9865fea9@arthur> References: <037601c2627f$00277630$9865fea9@arthur> <200209230233.g8N2Xqc04869@pcp02138704pcs.reston01.va.comcast.net> <000601c262b8$acebbc30$9865fea9@arthur> Message-ID: <200209231216.g8NCGkX06414@pcp02138704pcs.reston01.va.comcast.net> > All I'm lobbying for really is some precision in language Wish granted (if I ever get back to this). --Guido van Rossum (home page: http://www.python.org/~guido/) From guido@python.org Mon Sep 23 13:22:05 2002 From: guido@python.org (Guido van Rossum) Date: Mon, 23 Sep 2002 08:22:05 -0400 Subject: [Edu-sig] re: CP4E-2002 In-Reply-To: Your message of "Mon, 23 Sep 2002 12:30:24 +0200." <3D8EED40.5030300@aon.at> References: <037601c2627f$00277630$9865fea9@arthur> <200209230233.g8N2Xqc04869@pcp02138704pcs.reston01.va.comcast.net> <000601c262b8$acebbc30$9865fea9@arthur> <3D8EED40.5030300@aon.at> Message-ID: <200209231222.g8NCM5I06436@pcp02138704pcs.reston01.va.comcast.net> > I wonder why Paperts approach with turtle-graphics doesn't play a > more prominent role in these discussions nowadays. (In my opinion it > could be fruitful to integrate it better in efforts using Python in > education.) Turtle graphics were appropriate given the capacity of the hardware and software environment at the time Logo was developed. These days, the equivalent is much more flashy, but the idea is the same: visual output is wonderfully attractive. Various groups are using virtual reality, game development or other 3D graphics backends that are controlled by simple statements in the student's program. Alice was one example of this; VPython is another. I expect there are more. (Jeff Elkner is a rare exception in this space. :-) > I for my part, besides doing some courses for teachers here in > Vienna, I am involved in the process of writing a textbook about > programming with Python for Kids, in German. Hope to give it a push > here, this way. Wonderful! Keep us posted! Make sure it it mentioned on the Python website once it's available!!! --Guido van Rossum (home page: http://www.python.org/~guido/) From Jason Cunliffe" was {Re: [Edu-sig] Top 5 All Time Novice Obstacles => #3 Where am I ?} References: <001201c26040$bd23ab00$6501a8c0@vaio> <003301c26060$cb61b3e0$6501a8c0@vaio> <004b01c26071$30a3b040$6501a8c0@vaio> <200209201407.g8KE7xo06717@pcp02138704pcs.reston01.va.comcast.net> <003c01c261e2$ab4c4240$6501a8c0@vaio> <200209220609.g8M69P827583@pcp02138704pcs.reston01.va.comcast.net> <000c01c2620b$87e3a2c0$6501a8c0@vaio> <200209221316.g8MDG5n03721@pcp02138704pcs.reston01.va.comcast.net> <002f01c26272$c5eafa20$6501a8c0@vaio> <200209230238.g8N2c1i04885@pcp02138704pcs.reston01.va.comcast.net> Message-ID: <001c01c26300$55ac4be0$6501a8c0@vaio> > > Relative to your original CP4E grant proposal where you think Python > > stands now? > > Python has a long way to go -- but of the "real life" programming > languages (from Java to Scheme) it is still the best positioned to > succeed as a "first language". Yes Agreed ! > > If we were writing a CP4E-2002 proposal what would be the key > > points? > > A proposal never stands in a vacuum -- it depends on the agenda of the > funding organization to which the proposal is trying to sell its > ideas, and on the interests of those who want to be funded. Nicely put. For those who do have time for grant proposal writing, do you have any suggestions where to apply? ./Jason From guido@python.org Mon Sep 23 14:17:54 2002 From: guido@python.org (Guido van Rossum) Date: Mon, 23 Sep 2002 09:17:54 -0400 Subject: CP4E-2002 => was {Re: [Edu-sig] Top 5 All Time Novice Obstacles => #3 Where am I ?} In-Reply-To: Your message of "Mon, 23 Sep 2002 08:54:20 EDT." <001c01c26300$55ac4be0$6501a8c0@vaio> References: <001201c26040$bd23ab00$6501a8c0@vaio> <003301c26060$cb61b3e0$6501a8c0@vaio> <004b01c26071$30a3b040$6501a8c0@vaio> <200209201407.g8KE7xo06717@pcp02138704pcs.reston01.va.comcast.net> <003c01c261e2$ab4c4240$6501a8c0@vaio> <200209220609.g8M69P827583@pcp02138704pcs.reston01.va.comcast.net> <000c01c2620b$87e3a2c0$6501a8c0@vaio> <200209221316.g8MDG5n03721@pcp02138704pcs.reston01.va.comcast.net> <002f01c26272$c5eafa20$6501a8c0@vaio> <200209230238.g8N2c1i04885@pcp02138704pcs.reston01.va.comcast.net> <001c01c26300$55ac4be0$6501a8c0@vaio> Message-ID: <200209231317.g8NDHtL06583@pcp02138704pcs.reston01.va.comcast.net> > For those who do have time for grant proposal writing, do you have any > suggestions where to apply? Alas not. Since writing CP4E and suffering through its demise I have developed a thorough hatred for grant writing and funding organizations. --Guido van Rossum (home page: http://www.python.org/~guido/) From Jason Cunliffe" was {Re: [Edu-sig] Top 5 All Time Novice Obstacles => #3 Where am I ?} References: <030a01c26259$dc4e5e10$9865fea9@arthur> <003d01c26280$743ebdc0$6501a8c0@vaio> <200209230230.g8N2UMf04854@pcp02138704pcs.reston01.va.comcast.net> Message-ID: <002601c26304$0a10fe20$6501a8c0@vaio> > I've not looked much at it personally, but I trust a close colleague > who has, and who finds it hard to use because the parser cannot know > the end of a function's parameter list -- that's only known at run > time, once the function is called. Sounds like dead on arrival to me, > as far as language design goes. hmm... I do not understand what your friend means about the parser. I don't know much about parsers, but will ask around more. > Flash: Around 1996 I was approached by Macromedia to become their > director of language design. I declined, for a number of personal > reasons, and because I didn't think I would be able to steer them > sufficiently far away from where they were at the time. Since then, > it appears that they have adopted Javascript; they could've done > worse. Javascript shares some decent concepts with Python, in a more > traditional syntax. (I think part of this may be due to Jim Roskind, > who was at Netscape at the time that JS was developed, but was an > early Python adopter at Infoseek before then.) ahaa. Macromedia's loss but Python's gain, and I hope your own too ! You probably made a very wise decision. They flounderd until 1998/99 when Flash 5 jumped and adopted ECMAscript [Javascript]. It's not bad though. Moving between Python and Actionscript/Javascript is pretty painless. Too many { } ; but it does share many nice features. Misses Python's dictionary core, but one can fake some it with the As/Js Associative Arrays: ideas = new array(3); ideas['python'] = 'programming is fun'; ideas['actionscript'] = 'flash is fun'; ideas['edu-sig'] = 'everyone can enjoy learning to program'; I don't know of any way to match Python's superb keyword args syntax :-( It's one of the feature which I think makes Pyhon especially accessible as a 'first' language. > I'd like to add that Flash succeeded where Java applets have failed. Yes I agree, and interesting to see how Java has moved into larger server-side component projects and stand-alone applications. ./Jason From guido@python.org Mon Sep 23 14:27:14 2002 From: guido@python.org (Guido van Rossum) Date: Mon, 23 Sep 2002 09:27:14 -0400 Subject: ActionScript: => was {Re: [Edu-sig] Top 5 All Time Novice Obstacles => #3 Where am I ?} In-Reply-To: Your message of "Mon, 23 Sep 2002 09:20:51 EDT." <002601c26304$0a10fe20$6501a8c0@vaio> References: <030a01c26259$dc4e5e10$9865fea9@arthur> <003d01c26280$743ebdc0$6501a8c0@vaio> <200209230230.g8N2UMf04854@pcp02138704pcs.reston01.va.comcast.net> <002601c26304$0a10fe20$6501a8c0@vaio> Message-ID: <200209231327.g8NDREa06678@pcp02138704pcs.reston01.va.comcast.net> > > I've not looked much at it personally, but I trust a close colleague > > who has, and who finds it hard to use because the parser cannot know > > the end of a function's parameter list -- that's only known at run > > time, once the function is called. Sounds like dead on arrival to me, > > as far as language design goes. > > hmm... I do not understand what your friend means about the parser. > I don't know much about parsers, but will ask around more. I'm not sure, but I think a Rebol statement can look like a b c d This could mean a(b, c, d) or a(b(c), d) or a(b, c(d)) or a(b(c, d)), depending on how many arguments a takes and what b and c are. > Yes I agree, and interesting to see how Java has moved into larger > server-side component projects and stand-alone applications. There was a vacuum there waiting to be filled: legacy apps can't easily publish on the web, and CGI doesn't scale. The Java folks with their web foresight jumped into that first and got the market. --Guido van Rossum (home page: http://www.python.org/~guido/) From Jason Cunliffe" <200209230233.g8N2Xqc04869@pcp02138704pcs.reston01.va.comcast.net> <000601c262b8$acebbc30$9865fea9@arthur> <3D8EED40.5030300@aon.at> Message-ID: <004b01c26305$c0649a00$6501a8c0@vaio> > Regardless of how you see this, there remains much to do to bring Python to > the schools. ( It certainly was not by accident, that the announced > educational > section at EuroPython was cancelled?) It would certainly be useful to > discuss > ways how this could be accomplished in this forum. What do you suggest? > I for my part, besides doing some courses for teachers here in > Vienna, I am involved in the process of writing a textbook about programming > with Python for Kids, in German. Hope to give it a push here, this way. I hope it it gets translated into other languages too when published. good luck ./Jason From urban.anjar@hik.se Mon Sep 23 14:57:25 2002 From: urban.anjar@hik.se (Urban Anjar) Date: Mon, 23 Sep 2002 15:57:25 +0200 Subject: [Edu-sig] re: CP4E-2002 In-Reply-To: <200209231222.g8NCM5I06436@pcp02138704pcs.reston01.va.comcast.net> References: <037601c2627f$00277630$9865fea9@arthur> <200209230233.g8N2Xqc04869@pcp02138704pcs.reston01.va.comcast.net> <000601c262b8$acebbc30$9865fea9@arthur> <3D8EED40.5030300@aon.at> <200209231222.g8NCM5I06436@pcp02138704pcs.reston01.va.comcast.net> Message-ID: <1032789446.1991.100.camel@yoda> On Mon, 2002-09-23 at 14:22, Guido van Rossum wrote: > Turtle graphics were appropriate given the capacity of the hardware > and software environment at the time Logo was developed. These days, > the equivalent is much more flashy, but the idea is the same: visual > output is wonderfully attractive. (...) True, some decades ago kids were satisfied when they got 'hello, world' or something slightly more complicated printed onto the screen. Today they are spoiled by 3D-games. We have to give them more "flashy" toys to get them playing/working/learning. Urban Anjar --=20 Urban Anjar, IT-avdelningen, H=F6gskolan i Kalmar, 0480-446488 ,070-6093556 Handledningar: http://www.helpdesk.hik.se/handledning KLUG: http://wnanur.dse.hik.se/klug From urban.anjar@hik.se Mon Sep 23 15:01:13 2002 From: urban.anjar@hik.se (Urban Anjar) Date: 23 Sep 2002 16:01:13 +0200 Subject: [Edu-sig] re: CP4E-2002 In-Reply-To: <200209231222.g8NCM5I06436@pcp02138704pcs.reston01.va.comcast.net> References: <037601c2627f$00277630$9865fea9@arthur> <200209230233.g8N2Xqc04869@pcp02138704pcs.reston01.va.comcast.net> <000601c262b8$acebbc30$9865fea9@arthur> <3D8EED40.5030300@aon.at> <200209231222.g8NCM5I06436@pcp02138704pcs.reston01.va.comcast.net> Message-ID: <1032789673.1991.105.camel@yoda> On Mon, 2002-09-23 at 14:22, Guido van Rossum wrote: > Turtle graphics were appropriate given the capacity of the hardware > and software environment at the time Logo was developed. These days, > the equivalent is much more flashy, but the idea is the same: visual > output is wonderfully attractive. (...) True, some decades ago kids were satisfied when they got 'hello, world' or something slightly more complicated printed onto the screen. Today they are spoiled by 3D-games. We have to give them more "flashy" toys to get them playing/working/learning. Urban Anjar --=20 Urban Anjar, IT-avdelningen, H=F6gskolan i Kalmar, 0480-446488 ,070-6093556 Handledningar: http://www.helpdesk.hik.se/handledning KLUG: http://wnanur.dse.hik.se/klug From tim.one@comcast.net Mon Sep 23 15:51:52 2002 From: tim.one@comcast.net (Tim Peters) Date: Mon, 23 Sep 2002 10:51:52 -0400 Subject: ActionScript: => was {Re: [Edu-sig] Top 5 All Time Novice Obstacles => #3 Where am I ?} In-Reply-To: <002601c26304$0a10fe20$6501a8c0@vaio> Message-ID: [Guido] > I've not looked much at it personally, but I trust a close colleague > who has, and who finds it hard to use because the parser cannot know > the end of a function's parameter list -- that's only known at run > time, once the function is called. Sounds like dead on arrival to me, > as far as language design goes. [Jason Cunliffe] > hmm... I do not understand what your friend means about the parser. > I don't know much about parsers, but will ask around more. Well, I'm just a friend of Guido's , but here's *almost* an actual line of Rebol from a sample program (make-doc-pro.r) on the website. It's "almost" because I had to split the line to fit in my screen width; the original was all on one line: destinationfile: join first split-path file append first parse/all second split-path file "." ".html" Now as a Rebol programmer, you happen to know that "join" takes 2 arguments. There's no way to guess that from staring at the code above, and now that everyone else here knows that "join" takes 2 arguments, let's see how well they can guess what those arguments might be in the above. Or is there indeed *more* than just one top-level call to "join" in the above? You can't guess that either from staring at the code -- you have to know which of the words are functions, and how many arguments each function takes(*). When I played with Rebol, this kind of thing drove me nuts: because line boundaries aren't significant either, there are no reliable visual clues about the scope of function calls, where arguments begin or end, or even where conceptual statements begin and end. Make one mistake, and it can have semantic effects to the very end of the file's source code. That makes tracking down a runaway triple-quoted string in Python look like pure joy. I grant that the quoted line above is extreme in Rebol practice, but the "make one mistake" business isn't. Forget an argument, and Rebol will merrily chew up following lines at runtime until it finds a complete expression to *use* for the missing argument. Add an extra argument, and Rebol doesn't care either -- it will just take the start of the first excess argument as the start of a new function call. The lack of redundant syntax is pleasant in short and correct programs, but doesn't scale. (*) If you give up , "join", "append", and "parse/all" take 2 arguments each. "first", "split-path", and "second" take 1 argument each. "file" is not a function. Here's how to read it: join first split-path file append first parse/all second split-path file "." ".html" Rebol has some very cool ideas, btw -- this wasn't one of them. From Jason Cunliffe" was {Re: [Edu-sig] Top 5 All Time Novice Obstacles => #3 Where am I ?} References: <030a01c26259$dc4e5e10$9865fea9@arthur> <003d01c26280$743ebdc0$6501a8c0@vaio> <200209230230.g8N2UMf04854@pcp02138704pcs.reston01.va.comcast.net> <002601c26304$0a10fe20$6501a8c0@vaio> <200209231327.g8NDREa06678@pcp02138704pcs.reston01.va.comcast.net> Message-ID: <000f01c26313$a21f8ba0$6501a8c0@vaio> > I'm not sure, but I think a Rebol statement can look like > > a b c d > > This could mean a(b, c, d) or a(b(c), d) or a(b, c(d)) or a(b(c, d)), > depending on how many arguments a takes and what b and c are. Yes that's right. In practice REBOL 'blocks' [lists] help delineate most contexts clearly. One of the good edu-sig questions to ask is perhaps, why in practice do most people find this aspect of Rebol so very familiar and easy to deal with? My theory is that its because it partly follows the way our human (spoken,written) languages are structured. Clusterings of clauses and phrases with modifiers which move from beginning to end as narrative flow.. Different from more logic- or mathematically oriented structures. I like to think that Rebol moves in two directions at the same time. A sort of reverse FORTH communications stream ... <<<--- --->>> gathering up arguments and evaluating expressions, building functions sequenced series and narrative. Rebol is above all a messaging language, designed to handle expressions. Rebol PARSE is touted by some to be its 'jewel in the crown', allowing one to define sub-languages or 'Dialects'. I am still not sure how good an idea or not in practice. Too early to say yet anyway. Pro: Sweet short customized syntax fulfill application domain, meet end-user needs Con: Hidden behavior, and unfamiliar vocabulary risk [human] namespace confusion. http://www.rebol.com/docs/rebolintro.html http://rebol.com/docs/core23/rebolcore.html http://rebol.com/docs/core23/rebolcore-15.html Rebol parents are REXX, ARexx, FORTH, LISP, and LOGO. After designing the original AmigaOS, Carl Sassenrath became deeply involved in Smalltalk, then moved towards a different approach for Rebol. Declarative expressions where everything is data, and natural language is a major inspiration. Its FORTH roots are visible in the way it lets one define words very freely in-line. LISP influences mean that nested lists are the natural form, as expressed in blocks []. Mathematica does the same. One interesting parallel to draw is how Zope publishes the ZODB as URLS http://somesite.org/zope/section/subsection/method/quailfier/data/method/args But Zope 'acquisition' means that we are not looking at just an ordinary descending traversal of a tree path. Acquisition is Zope's maybe most potent, but confusing feature. I've not been following Zope closely for about 8 months, but I read somewhere that Zope3 is moving away from acquisition, because people find is too 'hard' to manage. Component framework is now the chosen design pattern. Python moves consistently, lucidly in one direction --->>> but lets one choose: function(object) object.function() Python white space indentation is main feature which makes it so 'readable'. But I am curious, when people teach Python and want to read/speak it out loud what do you say? How does one 'speak' Python? The object tree can be far from linear. It's been really fascinating to a view Leo's own python source in Leo. Once can load any file, but here's LeoPy.leo: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/leo/leo/LeoPy.leo It presents a clear tree structure interface, but 'clones' [aliases] and in-line 'includes' allow one get a much better overview than normal. It's easier to read visually, perhaps in a classroom out loud too. The new browsable 2.1++ module docs are very cool. Since Leo is 100% python, with API and full control of the outline tree, it is perhaps a fast way to explore alternate ideas/representations of the module docs idea. http://personalpages.tds.net/~edream/scripting.html#anchor612831 ./Jason From Jason Cunliffe" was {Re: [Edu-sig] Top 5 All Time Novice Obstacles => #3 Where am I ?} References: Message-ID: <005101c2632c$338bb560$6501a8c0@vaio> > destinationfile: join first split-path file append first parse/all second > split-path file "." ".html" lol Yes that's a great bad example! But you make excellent points. As I said before, one of the interesting edu-sig questions is: "Why, in practice, so many people very quickly find Rebol very comfortable and easy to read? I'm not into this for any langauge flamebait reasons. Rebol does something very clever which people respond well to. I hope we ask what's going here on? and can gain insights from it. Rebol imitates some aspects of the structure and habits of our natural human languages. In the future, I imagine programming languages, especially the interpreted scripting ones, will also be calmly included in that category. If not spoken, at least under subsection: "languages/human/written". I can also imagine highly visual/symbolic ones too - but I do not believe we have seen those yet. Though one can argue that no-phonetic writing systems are precursors [Egyptian or Mayan hieroglyphs, most Chinese ideograms]. "Toontalk" that Phillip Kent just mentioned is a step in that direction. Andy DiSessa's Boxer is a hybrid of script and visual symbol. http://www.soe.berkeley.edu/boxer/papers.html Because Rebol is an interactive intepreted language.like Python one naturally spends equal time between the shell and text editor. A Rebol programming session often feels less 'structural' than Python. Like FORTH one tends to think in terms of words a fledh them out out into phrases at the shell. Then cut'n'paste to the editor. The process means that it is very natural to write very simple short manageable phrases in the shell, quickly, iteratively building them up by inserting modifiers, variables and conditions. Then generalizing as functions or object structures. cat sat mat the cat sat on the mat the cat named "nyaowny" sat on the persian rug story: [Her little kitten sat on the persian rug, in the spot where the ornate pattern became perfect camoflage. One day [Insert chapter 2]] now tell me a story When one formalizes this and pastes into text editor, to keep it readable, it is typical to break lines to clarify the clausal and argument structures. Rebol's equivalent of Python brilliant uniform whitespace indentation is not a satisfactory one. But it works - define words well [keep them short and clear], use line breaks liberally and blocks []. story: [ Her little kitten sat on the persian rug, in the spot where the ornate pattern became perfect camoflage. One day [Insert chapter 2] ] There has been quite a bit of discussion on the REBOL list by developers trying to agree on a uniform syntax for [] indentation. One solution actually had switchable styles! The price for the freedom and flexibility of blocks is lack of uniform sytle. One reward is that one can just paste rebol code and 'do it. > Now as a Rebol programmer, you happen to know that "join" takes 2 arguments > ... Yes. As a rebol programmer you do have to know, and one does soon learn the core vocabulary. I gravitate to using words which take block argument words rejoin ["some string" variable function [param1 param2]] If it gets any longer than that, time for line breaks. Keep each phrase on its own line so it reads like a poem! Rebol uses a LOT of datatypes and functions args can specify them. With docstrings that improves debug clarity. Also there's a 'try' statement, so conscientious programmer can proper error trapping. for ones own code. > When I played with Rebol, this kind of thing drove me nuts: because line > boundaries aren't significant either, there are no reliable visual clues > about the scope of function calls, where arguments begin or end, or even > where conceptual statements begin and end. Make one mistake, and it can > have semantic effects to the very end of the file's source code. That makes > tracking down a runaway triple-quoted string in Python look like pure joy. Yes. I can imagine someone as profoundly skilled in Python as you, might have a harder time. In the beginning I found it very odd switching between Python and REBOL. - Is the REBOL approach better or worse then as a 'first' language ? - Better because people find it very easy? - Worse because it won't sacle or give them tough expectations in others? I often wonder how these programming langugages are perceived differently according to people's mother tongue [English, French, German, Korea, Chinese etc..]? Word order, lack of prepositions, conjugation, richness of specialforms, richness of verbs and ajectives, strictness.. Likewise how much does multiple languages help? They say all children have tremendous facility to learn several languages together at a young age. And that bi- tri- multi-lingual kids finds ti getseasoier and easier to absorb more languages. As they maure tehy can fill in the cirrect sytactic and grammar. For example, The HIPPO club members encourage simultaneous exposure to many languages as young as possible. Their premise is that basic pattern recognition and confidence come first. Structure will emerge and can be taught formally later along with correctness. It is no coindicdence that the same people developed the brilliant "Who is Fourier?" Though curiously most people find Rebol very fast to find mistakes. It could do wiht much better error prompts. Something that is harder to do because it line numbers and object paths are not cetain like Python. Its an issue the more advanced progammers have been discussing. Again, I think it is useful to look at why people find it so easy to find mistakes in Rebol. As an atrocious semi-dislexic typist, the syntactic differences are theory. If I make a single typo it will still screw up any program. And multiple ones can be tough. As long as scripting languages are the base of edu-sig , solid typing is a #1 requirement. > argument as the start of a new function call. The lack of redundant syntax > is pleasant in short and correct programs, but doesn't scale. Yes. Scale is another topic on Rebol list from time to time. I don't think anyone really knows for sure, as few large projects have been built in Rebol to date. REBOL/View and /IOS are perhaps the largest. Much of that REBOL code sitting above the compiled C kernel words. Scripts do tend be extremely short, compared with other languages. The word-based modular design of rebol programs is easy to grasp. Usually easy to share. But like FORTH it depends. The best Rebol programs are very easier to follow. Python source is mostly understandable, more than most languages, but great Python code is an eye-opener and pleasure. Some work is being done right now to develop a framework. For beginners, Rebol motivates by its very rapid prototyping. Python does too, but scales well. Leo is important new scalability tool. Starting from nothing it lets one think play with large scale projects and explore [design & analyze]. But is also helps manages and understand them as they grow dense. Seeing the structure is hard to do. > Rebol has some very cool ideas, btw -- this wasn't one of them. What do you think are the good ones? ./Jason From tim.one@comcast.net Mon Sep 23 20:14:47 2002 From: tim.one@comcast.net (Tim Peters) Date: Mon, 23 Sep 2002 15:14:47 -0400 Subject: Rebol readability=> was {Re: [Edu-sig] Top 5 All Time Novice Obstacles => #3 Where am I ?} In-Reply-To: <005101c2632c$338bb560$6501a8c0@vaio> Message-ID: [Jason Cunliffe] > ... > As I said before, one of the interesting edu-sig questions is: > "Why, in practice, so many people very quickly find Rebol very > comfortable and easy to read? I don't know that they do. I was active on the Rebol mailing list for a year, and most newbies appeared to be baffled by both the semantics and the (lack of) syntax. Few appeared to make swift progress in "getting it", either, and most left. A few hung on baffled the whole time I was there. The docs were a mess at that point in Rebol's life (much of the mailing list traffic at the consisted of "hey! I typed this in, and this is what I got! Can anyone guess what it's doing?"), and the language has changed some since then, but I stopped paying attention. > I'm not into this for any langauge flamebait reasons. Rebol does > something very clever which people respond well to. I'm afraid you lost me at the starting gate, Jason -- at the time I was active, Rebol appeared to have a hardcore set of fans from the Amiga world (where Sassenrath is a legend), and to them Rebol could do no wrong. Kind of like I praise every dumb idea of Guido's . I didn't see any evidence at the time of anyone else hopping on the bandwagon. So I simply can't speculate about why Rebol is quickly comfortable for so many people, because in my own experience of it that simply wasn't the case. >> Rebol has some very cool ideas, btw -- this wasn't one of them. > What do you think are the good ones? Many builtin datatypes, the "parse" subsystem, the interactive mode, the wonderfully painless installation, the ability for a function to specify "quoted" arguments (that's why you can do "help join" in Rebol and not have Rebol run off trying to evaluate the "join" function first -- the "help" definition says it wants its argument quoted), the idea of building a cursor into container objects which is then manipulated via side effect, the uniform use of "/" to build hierarchical namespaces doing multiple-duty for file literals and URL literals and even modifying function calls with optional arguments (like parse/all), the weak distinction between code and data. Many of those ideas would be a poor fit to Python, though, just as many of Python's cool features would be a poor fit to Rebol -- languages aren't bags of disconnected features you can pick and choose at random. Well, you can *try*, and then you get Perl5 . From Jason Cunliffe" was {Re: [Edu-sig] Top 5 All Time Novice Obstacles => #3 Where am I ?} References: Message-ID: <000a01c26357$4b1ea7c0$6501a8c0@vaio> > > "Why, in practice, so many people very quickly find Rebol very > > comfortable and easy to read? > > I don't know that they do. They do now. Thanks for clueing me in to your early Rebol experience. Sounds like it was very bleeding edge >:-( Things have certainly improved since then. Regular frustrated complaint-type questions are mostly about /View the GUI system whose official docs and examples lack+lag badly. And licensing/marketing ==> why not openSource etc? You can imagine where I stand on that! The rest is good stuff. Its a great community but *dangerously* small. The best programmers are in New Zealand, Australia, Czech republic and France. Go figure! The francophone ones don't post alas, much because of lower english language skills. ./Jason From urnerk@qwest.net Tue Sep 24 02:47:26 2002 From: urnerk@qwest.net (Kirby Urner) Date: Mon, 23 Sep 2002 18:47:26 -0700 Subject: [Edu-sig] More re Cross-pollinating Python with other Cool Languages In-Reply-To: <000a01c26357$4b1ea7c0$6501a8c0@vaio> References: Message-ID: <5.1.1.6.0.20020923183919.031ae6d0@pop.ptld.qwest.net> Since we're being such busy bees around Rebol here, I thought I'd bring in another language with some potentially good ideas. We allow 1e10 in Python (as 1*e^10), which in J opens the door to other numbers-with-letters-in-em, such as 1r2 (for 1/2), and 1j2 (for 1+2j), and some even more exotic variants. When it comes to smoothing a newbie's access to a first language, which might well be Python, I come up against such things as: (1j)^10 is an unsupported operand type for ^ yet pow(1j,10) is just fine. Why not have ^ invoke pow internally, if pow is more able to manage complex arguments? Anyway, the idea wanted to underline was the coolness of letting 1r2 mean 1/2 -- it's a primitive number, like 1e10, not a 'string' result of repr(). If Python ever incorporates a rational number type at the primitive level, I wonder if this'd be a way to go. 1r2 could still be an object, just like 1e10 is e.g. >>> dir(1e10) ['__abs__', '__add__', '__class__', '__cmp__', '__coerce__', '__delattr__', '__div__', '__divmod__', '__doc__', '__float__', '__floordiv__', '__getattribute__', '__hash__', '__init__', '__int__', '__long__', '__mod__', '__mul__', '__neg__', '__new__', '__nonzero__', '__pos__', '__pow__', '__radd__', '__rdiv__', '__rdivmod__', '__reduce__', '__repr__', '__rfloordiv__', '__rmod__', '__rmul__', '__rpow__', '__rsub__', '__rtruediv__', '__setattr__', '__str__', '__sub__', '__truediv__'] I imagine dir(1r2) would get you much the same, but also __numerator__ and __denominator__ or some such (for extracting either integer part). E.g. >>> 1r2 .__denom__() 2 >>> 3r4 .__numer__() 3 that kind of thing. Kirby From guido@python.org Tue Sep 24 03:16:44 2002 From: guido@python.org (Guido van Rossum) Date: Mon, 23 Sep 2002 22:16:44 -0400 Subject: [Edu-sig] More re Cross-pollinating Python with other Cool Languages In-Reply-To: Your message of "Mon, 23 Sep 2002 18:47:26 PDT." <5.1.1.6.0.20020923183919.031ae6d0@pop.ptld.qwest.net> References: <5.1.1.6.0.20020923183919.031ae6d0@pop.ptld.qwest.net> Message-ID: <200209240216.g8O2Giu21320@pcp02138704pcs.reston01.va.comcast.net> > (1j)^10 is an unsupported operand type for ^ > > yet pow(1j,10) is just fine. Why not have ^ invoke pow internally, > if pow is more able to manage complex arguments? Because ^ means xor in Python, ** is power. :-) > Anyway, the idea wanted to underline was the coolness of > letting 1r2 mean 1/2 -- it's a primitive number, like 1e10, > not a 'string' result of repr(). If Python ever incorporates > a rational number type at the primitive level, I wonder if > this'd be a way to go. [etc.] This is the subject of two PEPs, PEP 239 and 240. I hear that a new author is taking over editing, so maybe you'll find a willing ear there. --Guido van Rossum (home page: http://www.python.org/~guido/) From urnerk@qwest.net Tue Sep 24 03:52:01 2002 From: urnerk@qwest.net (Kirby Urner) Date: Mon, 23 Sep 2002 19:52:01 -0700 Subject: [Edu-sig] More re Cross-pollinating Python with other Cool Languages In-Reply-To: <200209240216.g8O2Giu21320@pcp02138704pcs.reston01.va.comca st.net> References: <5.1.1.6.0.20020923183919.031ae6d0@pop.ptld.qwest.net> Message-ID: <5.1.1.6.0.20020923195046.024cfb60@pop.ptld.qwest.net> At 10:16 PM 9/23/2002 -0400, Guido van Rossum wrote: > > (1j)^10 is an unsupported operand type for ^ > > > > yet pow(1j,10) is just fine. Why not have ^ invoke pow internally, > > if pow is more able to manage complex arguments? > >Because ^ means xor in Python, ** is power. :-) Oh yeah... (duh...) > > Anyway, the idea wanted to underline was the coolness of > > letting 1r2 mean 1/2 -- it's a primitive number, like 1e10, > > not a 'string' result of repr(). If Python ever incorporates > > a rational number type at the primitive level, I wonder if > > this'd be a way to go. [etc.] > >This is the subject of two PEPs, PEP 239 and 240. I hear that a new >author is taking over editing, so maybe you'll find a willing ear >there. Thanks for the pointer. Kirby From ajs@ix.netcom.com Wed Sep 25 13:57:58 2002 From: ajs@ix.netcom.com (Arthur) Date: Wed, 25 Sep 2002 08:57:58 -0400 Subject: [Edu-sig] Fw: Python sequences by reference - how to make Message-ID: <000501c26493$2c824460$9865fea9@arthur> I vowed not to make a mission of my copy import issue. And in my mind am living with it. But I do think it is an intersting point to discuss. Happens the the Quote of the Week from this weeks Dr Dobbs weekly Python URL http://www.ddj.com/topics/pythonurl/ is a Martelli quote that is from his response to the same post from Michal to python-list that instigating the discussion here. QOTW: "When something "is *EVERYWHERE*", how can it be "clearly VISIBLE" at the same time?" - Alex Martelli http://mail.python.org/pipermail/python-list/2002-September/123526.html A slightly fuller excerpt: """ *EVERY* assignment in Python uses reference semantics. Every occurrence of an assignment, therefore, makes reference behavior "clearly VISIBLE". Presumably fish don't find water "clearly VISIBLE", being used to that, much as it is for us and air. When something "is *EVERYWHERE*", how can it be "clearly VISIBLE" at the same time?-) """ Is it possible that "copy" clearly in the game as a built_in makes us slightly more amphibious? Hate to think that Martelli's suggestion that math types might need to stick with languages that implement a more uniformly functional model, is the only answer to this issue. Art From urnerk@qwest.net Wed Sep 25 15:15:01 2002 From: urnerk@qwest.net (Kirby Urner) Date: Wed, 25 Sep 2002 07:15:01 -0700 Subject: [Edu-sig] Fw: Python sequences by reference - how to make In-Reply-To: <000501c26493$2c824460$9865fea9@arthur> Message-ID: <5.1.1.6.0.20020925065546.02a18b30@pop.ptld.qwest.net> At 08:57 AM 9/25/2002 -0400, Arthur wrote: >Hate to think that Martelli's suggestion that math types might need to stick >with languages that implement a more uniformly functional model, is the only >answer to this issue. > >Art re: http://mail.python.org/pipermail/python-list/2002-September/123526.html Martelli's answer was quite interesting, as it mixes in a lot of history about computer languages. His main point is that assignment by reference, vs. assignment by copy, is the trend in modern languages, and being stuck on a copy-based semantics is not intrinsically a "math thing" -- it's just a habit of thought. This quote seems to argue against your suggestion: "You're in water. Water is *everywhere*. When you think there is nothing there, there's water. Just get used to it. Trying to muddy up the water in an attempt to make it more visible would be counter-productive." [fixed a typo] I think when we teach Python, the assignment-by-reference idea has to be made very clear: >>> a = [1, 2, 3] >>> thelist = [a,a,a] # same as [a]*3 >>> a[0]=42 >>> thelist # there's only one list in this picture [[42, 2, 3], [42, 2, 3], [42, 2, 3]] >>> b = a # b also points to a's list >>> id(a) # id() could be used when showing the identity 11095040 >>> id(b) 11095040 >>> a[0] = 92 >>> thelist = [a,b,a] # still only one list here [[92, 2, 3], [92, 2, 3], [92, 2, 3]] So how do we get another copy of a to play with? >>> from copy import copy >>> b = copy(a) # now b points to its own list >>> a[1] = 17 >>> a [92, 17, 3] >>> b # b is unchanged [92, 2, 3] So back to our original example (with copy still available): >>> a = [1,2,3] >>> thelist = [a,copy(a),copy(a)] >>> a[0] = 42 >>> thelist [[42, 2, 3], [1, 2, 3], [1, 2, 3]] Stuff like that. I think one could argue that "teaching by changing the list of built-ins" is too subtle to really make newbies notice. Beginners don't necessarily know how to get a list of what's built in. How would they know 'copy' is even present? They rely on a book to tell them, which book then goes through each feature. But if you're relying on a book or tutorial, then the same source might as well give examples of what's *not* a built in, e.g. copy. I'd think the math people would be especially easy to educate: just as you must import sin, cos, log, so must you import copy, i.e. lots of functionality is in the libraries (same with C, same with Java, same all modularized languages). Kirby From Jason Cunliffe" was {Re: [Edu-sig] Fw: Python sequences by reference - how to make} References: <000501c26493$2c824460$9865fea9@arthur> Message-ID: <001c01c2649f$30d77740$6501a8c0@vaio> Interesting quotes.. thanks. http://mail.python.org/pipermail/python-list/2002-September/123526.html "Python uses reference semantics. When you want a copy, you ask for a copy -- it's as simple as this. If you don't ask for a copy, you don't get a copy... you get a reference to the original. There is no complication: it's _always_ this way. " - Alex Martelli That's a really helpful explanation. He writes so well :-) > Presumably fish don't find water "clearly VISIBLE", being used to that, > much as it is for us and air. When something "is *EVERYWHERE*", how > can it be "clearly VISIBLE" at the same time?-) [OT] I am not questioning the Python copy() suggestions, but regarding fish in water, and people in air, don't you think it is also always and everywhere a matter of context and degree? It's fun to extend the analogy to how are are with this programming stuff.. Water is not just water, as Air is not just air. Very deep sea fish effectively live without sunlight, though often with other photo/electro-phoresence of other species. [cf. 'lantern fish']. They develop some very strange physical forms to adapt. sound, smell, taste, current temperature. http://people.whitman.edu/~yancey/deepsea.html Mid-depth fish must be more aware of light. But yes still spend 100% of their lives in water. Surface fish many of them know well here the edges are. water vs. surface + air People despite spending their lives in air, are likewise conscious to a greater or lesser degree, thanks to our senses. Clean air, fresh air, hayfevers, humidity, old icy air, hot dust, sea breezes, city air mountain air, [stinky new york august air], etc.. As kids we are fascinated with holding our breath, putting our heads in plastic bags, going in closets etc. Firemen, smokers and sick or dying people have another more serious sensibility. Athletes, swimmers and lovers celebrate consciousness of existence and air. Meditation practices focus on the essence and meaning of breath - in/out, who we are, and how time, mind and body are affected. regards ./Jason From ajs@ix.netcom.com Wed Sep 25 15:34:23 2002 From: ajs@ix.netcom.com (Arthur) Date: Wed, 25 Sep 2002 10:34:23 -0400 Subject: [Edu-sig] Fw: Python sequences by reference - how to make References: <000501c26493$2c824460$9865fea9@arthur> <200209251422.g8PEMdP02255@odiug.zope.com> Message-ID: <000801c264a0$a58cd390$9865fea9@arthur> Guido writes - > Copying issues generally crop up with lists. Copying a list is done > with [:]. You can't get much more built-in than that. It seems clear you object to an approach to discssing this kind of thing that is highly rhetorical. And as I said before, I acknowledge that *I* am the one out of water. But maybe that's the point a little. Using Alex's anology I would argue that [:], from the perspective of a fish, does represent somethingof an underwater rock formation. A fish does know that everything is not water. But [:] still gives us no sight of land. Art From ajs@ix.netcom.com Wed Sep 25 16:05:37 2002 From: ajs@ix.netcom.com (Arthur) Date: Wed, 25 Sep 2002 11:05:37 -0400 Subject: [Edu-sig] re: Python sequences by reference - how to make Message-ID: <000501c264a5$01d876a0$9865fea9@arthur> Kirby writes - >I'd think the math people would be especially easy to educate: >just as you must import sin, cos, log, so must you import copy, >i.e. lots of functionality is in the libraries (same with C, >same with Java, same all modularized languages). I agree, at least in some sense. And one of the questions I suggested needed to be answered is how far my experince could be generalized. My situation was - little outside direction, and a lot of pounding at the command line. So I cannot claim that my view is tremendously relevant to folks learning Python in some fundamentally different way, i.e. to folks being "educated" in some more formal environment. Which is one of the reason I can be reasonable in respect to anyone's suggestion that my concept here it not ready for prime time. Art From Jason Cunliffe" > shell vs. editor Message-ID: <002801c264a8$0055c6e0$6501a8c0@vaio> [Follow-up on my recent harvest full-moon rants] Tim Peters is right as usual. My assumptions that most people very quickly feel comfortable with Rebol are mistaken. Some do, some don't. The ones who stay with it [and whom I encounter] mostly tend to be the people who took to it like ducks to water. The others indeed flounder, finding the freeform dynamic qualities hard and confusing. I've been asking why, and considering characteristics of Python and Rebol as I switch between them.. Python is very architectural and its #1 characteristic is readability and consistency. As Guido and Tim quickly pointed out, Python leaves one in no doubt. Reading other people's Python code is therefore especially valuable for learning. Python encourages one to think structurally, by its design and with the tools it provides. It is also very writable. The shell and immediate self awareness of new objects in the dictionary. One analogy is how well one quickly one can follow when entering a movie or conversation somewhere in the middle. Python provides full-time subtitles, free headset with UN translator and an index for the whole event. ................... Rebol is conversational, narrative and poetic. It is very writeable [like FORTH], because one can build up words and meaning rapidly inline as part of a message stream. Rebol programmers perhaps depends more on the shell. I think in Rebol people have more iterative writing workflow sessions, using frequent cut and paste in both directions. Moving between shell and editor to refine elegant short final versions. Rebol is harder to read. It depends upon a core vocabulary, fluency of idiom, building pattern recognition. And upon the skill with which the writer chose his words. It is poetic like good FORTH. Leo Brodie's classic book "Starting Forth" described this art and process well. Rebol is a little like a movie where one can get out of one's seat and climb right into the film and join in the conversation. You may or may not be welcome and understood by those there. Exciting, uncertain stuff. "Purple Rose of Cairo", USA [] dir: Woody Allen http://dvdmg.com/purpleroseofcairo.shtml "Escape from Cinema Liberty", Poland [1991] Exuberant attack on censorship parodies Polish politics and 'The Purple Rose of Cairo' in the same breath. 92 min. http://www.hollywood.com/movies/detail/movie/179041 http://www.y.net.ye/polemb/kulturae.html I'd be interested to hear how others move between shell and editor in Python.. What have you observed about beginners and developing habits? ./Jason From guido@python.org Wed Sep 25 15:22:38 2002 From: guido@python.org (Guido van Rossum) Date: Wed, 25 Sep 2002 10:22:38 -0400 Subject: [Edu-sig] Fw: Python sequences by reference - how to make In-Reply-To: Your message of "Wed, 25 Sep 2002 08:57:58 EDT." <000501c26493$2c824460$9865fea9@arthur> References: <000501c26493$2c824460$9865fea9@arthur> Message-ID: <200209251422.g8PEMdP02255@odiug.zope.com> > Is it possible that "copy" clearly in the game as a built_in makes us > slightly more amphibious? The only example that came up here so far was the issue of initializing a multi-dimensional array properly, which cannot be solved with copying alone. Copying issues generally crop up with lists. Copying a list is done with [:]. You can't get much more built-in than that. --Guido van Rossum (home page: http://www.python.org/~guido/) From pobrien@orbtech.com Wed Sep 25 16:37:21 2002 From: pobrien@orbtech.com (Patrick K. O'Brien) Date: Wed, 25 Sep 2002 10:37:21 -0500 Subject: [Edu-sig] Top 5 All Time Novice Obstacles => #2 Helping help In-Reply-To: <003d01c261e4$0ec4a000$6501a8c0@vaio> Message-ID: [Jason Cunliffe] > > Pat, thanks for the reminder about your 'PyCrust'. > I'll be sure to check it out properly. Sounds good. > > Please can you tell me more about whose using it, what's popular > and where you > see it going? > Also, what's the relationship between PyCrust and PythonCard? I know there are several people and projects using PyCrust, but like most Open Source software I have no way of telling everyone that's using it. And I'm usually the last one to find out. I'm probably the biggest user of it. I use it almost every day. Any time I need to experiment with Python code I do so in PyCrust. There are two main ways to use PyCrust: as a standalone shell application, and as an embedded component in a wxPython application. PythonCard uses it in the second fashion, so that any application created with PythonCard has the ability to expose an interactive Python shell at runtime with access to the application's namespace. This is pretty cool in action. I covered much of this in an article on the O'Reilly website at http://www.onlamp.com/pub/a/python/2002/07/18/pycrust.html. Every so often I do a search on Google and find other projects using it this way. For example, the GnuMed project has been using it for some time now. The Boa Constructor guy (Riaan Booysen) and I have talked about replacing the Boa shell with PyCrust, but neither of us has made a concerted effort to do it. Since PyCrust is shipping with wxPython I would think it's getting pretty good exposure. As for the future, I'm not sure. I love working in the Python shell. I consider it an important interface, along with the command line, web, and GUI. I always strive to make my programs, modules, class, and functions usable and friendly to all of these interface environments. The Python shell is the ultimate in interactive, yet minimalistic, user interfaces. PyCrust builds on that by adding certain graphical conveniences as well as the usual stuff, like command recall, multi-line editing, and such. And I'll continue to evolve it as new ideas come out. As one example, someone was using PyCrust inside an application that controlled other scientific applications. And they wanted the autocompletion popup list feature to be triggered by a slash / as well as a dot, because they were allowing commands in the shell using a special syntax that wasn't standard Python. So I added that capability. Unfortunately, I don't think this application was Open Source so you can't see exactly what they were doing with it. But it is interesting how people will come up with clever ways to use the Python shell. Pat -- Patrick K. O'Brien Orbtech ----------------------------------------------- "Your source for Python programming expertise." ----------------------------------------------- Web: http://www.orbtech.com/web/pobrien/ Blog: http://www.orbtech.com/blog/pobrien/ Wiki: http://www.orbtech.com/wiki/PatrickOBrien ----------------------------------------------- From Jason Cunliffe" was:{Re: [Edu-sig] Top 5 All Time Novice Obstacles => #2 Helping help} References: Message-ID: <002b01c2650e$7e947040$6501a8c0@vaio> Thanks Patrick for filling us in on PyCrust. Good article too. Is PyCrust running on Macs, OSX ? ./Jason From gritsch@iue.tuwien.ac.at Thu Sep 26 08:05:08 2002 From: gritsch@iue.tuwien.ac.at (Markus Gritsch) Date: Thu, 26 Sep 2002 09:05:08 +0200 Subject: PyCrust => was:{Re: [Edu-sig] Top 5 All Time Novice Obstacles => #2 Helping help} References: <002b01c2650e$7e947040$6501a8c0@vaio> Message-ID: <3D92B1A4.1060407@iue.tuwien.ac.at> Jason Cunliffe wrote: > Thanks Patrick for filling us in on PyCrust. > Good article too. > > Is PyCrust running on Macs, OSX ? The webpage says, it does. Markus From fig@monitor.net Thu Sep 26 09:50:19 2002 From: fig@monitor.net (Stephen R. Figgins) Date: Thu, 26 Sep 2002 03:50:19 -0500 Subject: PyCrust => was:{Re: [Edu-sig] Top 5 All Time Novice Obstacles => #2 Helping help} In-Reply-To: <002b01c2650e$7e947040$6501a8c0@vaio> Message-ID: On 9/25/02 10:40 PM, "Jason Cunliffe" wrote: > Is PyCrust running on Macs, OSX ? I have it running on Jaguar. I used the Macho Python and wxPython binary distributions though. Don't know how easy it is to compile. -Stephen From pobrien@orbtech.com Thu Sep 26 12:34:19 2002 From: pobrien@orbtech.com (Patrick K. O'Brien) Date: Thu, 26 Sep 2002 06:34:19 -0500 Subject: PyCrust => was:{Re: [Edu-sig] Top 5 All Time Novice Obstacles => #2 Helping help} In-Reply-To: <002b01c2650e$7e947040$6501a8c0@vaio> Message-ID: [Jason Cunliffe] > > Thanks Patrick for filling us in on PyCrust. > Good article too. > > Is PyCrust running on Macs, OSX ? As far as I know it is, but I don't have a Mac so I have to rely on what others report. Over the last several months there was a big push to get wxPython running properly on the Mac. I'm sure there are still some minor issues, but the Mac is definitely a target platform for wxPython. And Robin Dunn is fond enough of PyCrust that he does his best to make sure it still works properly with each release of wxPython. Pat -- Patrick K. O'Brien Orbtech ----------------------------------------------- "Your source for Python programming expertise." ----------------------------------------------- Web: http://www.orbtech.com/web/pobrien/ Blog: http://www.orbtech.com/blog/pobrien/ Wiki: http://www.orbtech.com/wiki/PatrickOBrien ----------------------------------------------- From gef@ceid.upatras.gr Sat Sep 28 22:52:23 2002 From: gef@ceid.upatras.gr (Fotis Georgatos) Date: Sun, 29 Sep 2002 00:52:23 +0300 Subject: [Edu-sig] Are you series() on teaching with range()? Message-ID: <20020929005223.A14639@ainos.kefalonia.com> So, I just finished a presentation today in an educational conference here in Rhodes (Greece) regarding a research work done with Python during last year. (look for more on that at http://amstel.science.uva.nl/~fotisg/python/) In the meantime, I have optimized my wrapper function for the xrange() keyword, and its range() equivalent, which both seem to constantly confuse a few novices: >>> def xseries(first,last,step=1): if last>=first and step>=0: return xrange(first,last+1,step) elif last>> def series(first,last,step=1): return [x for x in xseries(first,last,step)] >>> series(100,-8,-3) [100, 97, 94, 91, 88, 85, 82, 79, 76, 73, 70, 67, 64, 61, 58, 55, 52, 49, 46, 43, 40, 37, 34, 31, 28, 25, 22, 19, 16, 13, 10, 7, 4, 1, -2, -5, -8] Compare with... >>> range(100,-8,-3) [100, 97, 94, 91, 88, 85, 82, 79, 76, 73, 70, 67, 64, 61, 58, 55, 52, 49, 46, 43, 40, 37, 34, 31, 28, 25, 22, 19, 16, 13, 10, 7, 4, 1, -2, -5] Am I the only one reporting this case with range()? PS. A random gift... http://amstel.science.uva.nl/~fotisg/python/documents/computer_languages_evolution.png And if you decide to read the .pdf on the same site, prefer to print it in order to read easily the anecdotal footnotes... cheers, Fotis From urnerk@qwest.net Mon Sep 30 20:14:20 2002 From: urnerk@qwest.net (Kirby Urner) Date: Mon, 30 Sep 2002 12:14:20 -0700 Subject: [Edu-sig] Re: Still working on rational numbers PEP? In-Reply-To: References: <5.1.1.6.0.20020930093945.02ebf900@pop.ptld.qwest.net> <5.1.1.6.0.20020930082819.02e036d0@pop.ptld.qwest.net> <5.1.1.6.0.20020926165418.03589de0@pop.ptld.qwest.net> <5.1.1.6.0.20020926165418.03589de0@pop.ptld.qwest.net> <5.1.1.6.0.20020930082819.02e036d0@pop.ptld.qwest.net> <5.1.1.6.0.20020930093945.02ebf900@pop.ptld.qwest.net> Message-ID: <5.1.1.6.0.20020930113718.02e6b790@pop.ptld.qwest.net> ============ "Christopher A. Craig" wrote: I think your problem is in assuming that Python 3 division will return a float. The plan for Python 3 is that the / operator will return "a reasonable approximation to the mathematical result of division."[1] The reason it is presently slated to return a float is that there is no rational in Python. Guido has even stated [2] By the time 3.0 comes around, (1L<<2000)/1 will probably return a rational number. But until we have added rationals, I think that for most apps, long/long -> float is the only definition that is consistent with the other requirements... So if rationals go in before 3.0, 1/2 may be the rational one-half and not the float 0.5. Changing the behaviour of the divide operator is going to break a bunch of code regardless of whether the new code returns a float or a rational, but that breakage is already scheduled to happen. > >>> a = 1r2 + 1r2 > >>> a > 1 > >>> 1/a > 1 > >>> a/3 > 1r3 > > If you have the time, please show me how you would express the > above using your proposed extensions. > >>> 1/2 1/2 >>> a = 1/2 + 1/2 >>> a 1 >>> 1/a 1 >>> a/3 1/3 >==================================================================== Kirby: I think there's an option to be less radical and break less pre- existing code. According to the above scenario, code rewritten to accommodate 1/2 == 0.5 as per recent changes, will have to be rewritten *again*. I would prefer to see / return a rational if and only both arguments are rational. Otherwise it should return a float, as per the current plan. Rational arithmetic is in general rather expensive, and the expectation the 4/17 will take us into floating point territory is entirely reasonable I think. Only if 4 and 17 are both type rational would 4/17 then not return a type float answer. So I would prefer we keep the option to go: >>> 5e_1 0.5 >>> 1r2 1r2 on the table. Maybe I will subscribe to python-dev and try to at least prompt a little worthwhile discussion of the proposal, recognizing that it may well be dismissed. Or you could do a quick blurb on "what Kirby thinks". In the meantime, I'm CC-ing this to edu-sig, where this thread got started (for me). I thank you for you patience in bringing me up to speed on the current proposal. Given we're in the initial stages of this and a lot of Pythonistas may not be aware of the J language option, which is quite viable, I think it should at least be looked at. In J, the division operator is % (because / means something else). So in J, a conversation might go like this: 1%2 NB. i.e. 1/2 -- same as Python 2.3 0.5 1r2 1r2 1r2 + 1r3 5r6 1%2 + 1%3 0.428571 The last line above is a surprise -- because J (unlike Python) has no concept of operator precedence (Python should stay the way it is of course). 1%2 + 1%3 really means (in Python) 1/(2 + (1/3)). To get more what we'd expect, we go: (1%2) + (1%3) 0.833333 (x:0.5555) % 1r2 NB. x: coerces 0.5555 to be rational 1111r1000 In Python, we might go: >>> rat(0.5555) 1111r2000 >>> rat(0.5555)/1r2 1111r1000 The main objection to my proposal, I think, is that it seems to return us to the bad old days (like now), when / can do different things depending on the types of the operands. But of course that's true with many operands. float + float is float, int + int is int. The objection, specifically in the case of division, is you "lose information" by returning 0 in place of 0.5 (depending on whether this is int/int or float/float) -- these are NOT "reasonably equivalent" answers. In contrast, returning a rational type would be to return the *fractional equivalent* of a float, i.e. the results are arguably the same, within tolerance. Just as 1.0 == 1, so 1r2 == 0.5 == 5e_1. so no information is lost, perhaps conforming to Guido's long term intentions for / (of course I don't speak for Guido in any way -- maybe I'm way off base here). In J, when you coerce pi to a rational, you get: 1285290289249r409120605684 which in floating point is 3.1415926535896439. That's not *quite* the same as >>> math.pi 3.1415926535897931 but in Python we'd be free to go to more decimal places using longs in both numerator and denominator -- if we want (could do that in J to -- I'll have to ask why they didn't). Kirby