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',