Re: skip last line in loops

2006-12-14 Thread tac-tics
Try: afile = open(filename) lines = afile.readlines()[:-1] # assigns all except the last element to a list "lines" for line in lines: print line -- http://mail.python.org/mailman/listinfo/python-list

Re: skip last line in loops

2006-12-14 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > how can i skip printing the last line using loops (for /while) > > eg > > for line in open("file): > print line. > > I want to skip printing last line of the file. do it lazily: last_line = None for line in open("file): if last_line:

Re: MySQLdb windows binaries for Python 2.5?? Yes, but from a World of Warcraft guild.

2006-12-14 Thread John Nagle
John Nagle wrote: >What's happened is that Python fell through the cracks here. MySQL > themselves support Java, Microsoft ".NET", PHP, and a C interface. > The Perl interface to MySQL is part of the supported Perl distribution. > But for for Python, everybody is running on glue code from one

Re: skip last line in loops

2006-12-14 Thread James Stroud
James Stroud wrote: > [EMAIL PROTECTED] wrote: >> hi, >> how can i skip printing the last line using loops (for /while) >> >> eg >> >> for line in open("file): >> print line. >> >> I want to skip printing last line of the file.thanks >> > > afile = open(filename) > > xlines = afile.xreadline

Re: skip last line in loops

2006-12-14 Thread James Stroud
[EMAIL PROTECTED] wrote: > hi, > how can i skip printing the last line using loops (for /while) > > eg > > for line in open("file): > print line. > > I want to skip printing last line of the file.thanks > afile = open(filename) xlines = afile.xreadlines() aline = xlines.next for nextlin

Re: The Famous Error Message: "ImportError: No module named python_script"

2006-12-14 Thread greg
Gabriel Genellina wrote: > I bet your file is actually called fibo.py.txt then. > (Perhaps some advise should be provided for Windows users, about > enclosing the name inside "double quotes", or selecting "All files > (*.*)" on the file type list) Also, if by some chance you've got "Hide filena

Re: The Famous Error Message: "ImportError: No module named python_script"

2006-12-14 Thread greg
rich murphy wrote: > So, I assumed "the current directory" is C:\Python25 which did not > work... What directory does it mean then? It means the current directory of the process running the Python interpreter, which, unless you've done something to change it, will be the same as the current direct

Re: beginner, thread & else

2006-12-14 Thread Fredrik Lundh
Gigs_ wrote: > can someone explain me this code did you write that yourself, or did you find it in some book or article? > -- > import thread the thread module should not be used directly by application programs; use the "threading" module instead. > stdoutmute

skip last line in loops

2006-12-14 Thread eight02645999
hi, how can i skip printing the last line using loops (for /while) eg for line in open("file): print line. I want to skip printing last line of the file.thanks -- http://mail.python.org/mailman/listinfo/python-list

Weekly Python Patch/Bug Summary

2006-12-14 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 414 open ( +1) / 3498 closed ( +9) / 3912 total (+10) Bugs: 949 open ( +6) / 6376 closed (+12) / 7325 total (+18) RFE : 247 open ( +1) / 245 closed ( +1) / 492 total ( +2) New / Reopened Patches __ C99 _Bool

Re: WHAT is [0] in subprocess.Popen(blah).communicate()[0]

2006-12-14 Thread Fredrik Lundh
Gabriel Genellina wrote: >> I like using pattern matching in these simple cases: >> >> last_line, _ = subprocess.Popen([r"tail","-n 1", "x.txt"], >> stdout=subprocess.PIPE).communicate() > > pattern matching??? http://www.haskell.org/tutorial/patterns.html (the syntax's called "tar

Re: Is it good to create a thread in a non gui thread?

2006-12-14 Thread Gabriel Genellina
At Friday 15/12/2006 02:15, Lialie - KingMax wrote: Please keep your posting on the list. Gabriel Genellina wrote: > At Thursday 14/12/2006 23:55, Lialie - KingMax wrote: > >> I create a thread in a non gui thread, and it does well. But it seems >> strange. Somebody told me better not for it ma

Re: speed of python vs matlab.

2006-12-14 Thread greg
Chao wrote: > I did some search, in previous discussion, people has compared > python/numpy vs matlab, > but it is actually comparison between numpy(which is implemented in c) > vs matlab. Yes, matlab is operating on whole arrays at a time, like numpy. So it's not surprising that they have compar

Re: Conditional iteration

2006-12-14 Thread greg
at wrote: > With the current Python syntax, I can create for every two lines of code a > dozen alternative implementations: The "one way to do it" rule seems to be widely misquoted and misunderstood. Of course any Turing-complete programming language is going to provide infinitely many ways of e

Re: Conditional iteration

2006-12-14 Thread greg
at wrote: > I think by approving > > a = b if condition else c Again, this allows something to be written as an expression that formerly could only be written as a statement, which is a much bigger gain than just crunching two statements into one. -- Greg -- http://mail.python.org/mailman/list

Re: Writing and reading variables to/from flat file

2006-12-14 Thread Jonathan Curran
On Thursday 14 December 2006 09:31, Kevin Walzer wrote: > I want to write some variables (user preferences, specifically) to a > text file and then read the values from that file. > > Here is my code to write the data: > > verbosemodes= """ > Detailed = "-vv" > Basic = "-q" > """ > > fi

How does python handle VBS "Nothing" keyword

2006-12-14 Thread cfriedalek
I'm writing a python script using win32com to call a 3rd party program via its VBS based API. In VBS a query to get some plot data goes like this: Plot.QueryBegin datacode, Nothing What is this in python? Plot.QueryBegin(datacode, None) does not work. I get a type mismatch error as follows: co

Re: Is it good to create a thread in a non gui thread?

2006-12-14 Thread John Henry
Yes, boogie man may show up and start munching your program. Lialie - KingMax wrote: > Hi, > I create a thread in a non gui thread, and it does well. But it seems > strange. Somebody told me better not for it may cause something hard to > imagine. > Is there any different between them? > > THX -

Re: automatically grading small programming assignments

2006-12-14 Thread Dan Bishop
On Dec 14, 8:36 pm, Brian Blais <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > [EMAIL PROTECTED] wrote: > > Then on your PC you can > >> run a script that loads each of such programs, and runs a good series > >> of tests, to test their quality... > > What happens if someone-- perhaps not

Re: I'm looking for a pythonic red-black tree...

2006-12-14 Thread placid
Just Another Victim of the Ambient Morality wrote: > I need a red-black tree in Python and I was wondering if there was one > built in or if there's a good implementation out there. Something that, > lets face it, does whatever the C++ std::map<> allows you to do... > Thank you... try, htt

Re: Is it good to create a thread in a non gui thread?

2006-12-14 Thread Gabriel Genellina
At Thursday 14/12/2006 23:55, Lialie - KingMax wrote: I create a thread in a non gui thread, and it does well. But it seems strange. Somebody told me better not for it may cause something hard to imagine. Is there any different between them? I'm not sure if I understand the question. You can h

Re: MySQLdb windows binaries for Python 2.5?? Yes, but from a World of Warcraft guild.

2006-12-14 Thread John Nagle
Fuzzyman wrote: > johnf wrote: > >>John Nagle wrote: >> >> >>>Jan Dries wrote: >>> [EMAIL PROTECTED] wrote: >I'm also looking for a MySQLdb binary for windows. This is holding me >from upgrading from Python 2.4 to Python 2.5 ! > If you search the Help Forum of th

Re: automatically grading small programming assignments

2006-12-14 Thread Paul Rubin
Brian Blais <[EMAIL PROTECTED]> writes: > Unfortunately, it takes a lot of time to grade such things by hand, so > I would like to automate it as much as possible. > ... > Or perhaps there is a better way to do this sort of thing. How do > others who teach Python handle this? I think you should n

Is it good to create a thread in a non gui thread?

2006-12-14 Thread Lialie - KingMax
Hi, I create a thread in a non gui thread, and it does well. But it seems strange. Somebody told me better not for it may cause something hard to imagine. Is there any different between them? THX -- http://mail.python.org/mailman/listinfo/python-list

Re: automatically grading small programming assignments

2006-12-14 Thread Paddy
Brian Blais wrote: > [EMAIL PROTECTED] wrote: > > [EMAIL PROTECTED] wrote: > > Then on your PC you can > >> run a script that loads each of such programs, and runs a good series > >> of tests, to test their quality... > > What happens if someone-- perhaps not even someone in the class-- does > >

Re: need clarification with import statements

2006-12-14 Thread John Machin
Tool69 wrote: > Hi, > I've got the following hierarchy: > > mainprog/ > __init__.py > prog.py > utils/ > __init__.py > myutils.py > others/ > __init__.py > myothers.py > > Inside prog.py I need to have full access to myutils.py and > myothers.py; > I

Re: automatically grading small programming assignments

2006-12-14 Thread Brian Blais
Paddy wrote: > It might turn out to be a poor substitute for the personal touch, > especially If they are just starting to program. Oh, I didn't mean it to completely replace me grading things, but I think it would be useful if there were a lot of little assignments that could be done automatica

Re: automatically grading small programming assignments

2006-12-14 Thread Brian Blais
[EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote: > Then on your PC you can >> run a script that loads each of such programs, and runs a good series >> of tests, to test their quality... > What happens if someone-- perhaps not even someone in the class-- does > some version of os.system('rm -Rf /

Re: merits of Lisp vs Python

2006-12-14 Thread Gabriel Genellina
Warning: absolutely off topic! At Thursday 14/12/2006 08:02, Christophe wrote: Well, I spent some time on Wikipedia looking up metric systems and things like that because of you, and I found a page that shows how to improve the current SI system by reducing the number of fundamental units to on

Re: I'm looking for a pythonic red-black tree...

2006-12-14 Thread Gabriel Genellina
At Thursday 14/12/2006 22:20, Just Another Victim of the Ambient Morality wrote: I need a red-black tree in Python and I was wondering if there was one built in or if there's a good implementation out there. Something that, lets face it, does whatever the C++ std::map<> allows you to do...

active directory

2006-12-14 Thread stavenko
Hello all. I'm trying ot get users from Active directory. using python-ldap. We have a windows network domain. So I tried this code: import ldap l = ldap.initialize("ldap://ldap.server";) l.protocol_version = ldap.VERSION3 l.simple_bind_s('','') for i in l.search_ext_s("CN=Users,dc=ldap,dc=server

I'm looking for a pythonic red-black tree...

2006-12-14 Thread Just Another Victim of the Ambient Morality
I need a red-black tree in Python and I was wondering if there was one built in or if there's a good implementation out there. Something that, lets face it, does whatever the C++ std::map<> allows you to do... Thank you... -- http://mail.python.org/mailman/listinfo/python-list

Re: Password, trust and user notification

2006-12-14 Thread Gabriel Genellina
At Thursday 14/12/2006 20:22, placid wrote: Is there any other way (other than email's !) to notify a user of events within a script? - Any IM like Jabber, MSN Messenger, ICQ... - Cell phone SMS - A telephone call delivering a prerecorded message or using text-to-speech technology - Reversed:

Re: MySQLdb windows binaries for Python 2.5?? Yes, but from a World of Warcraft guild.

2006-12-14 Thread Fuzzyman
johnf wrote: > John Nagle wrote: > > > Jan Dries wrote: > >> [EMAIL PROTECTED] wrote: > >> > >>> I'm also looking for a MySQLdb binary for windows. This is holding me > >>> from upgrading from Python 2.4 to Python 2.5 ! > >>> > >> > >> If you search the Help Forum of the MySQLdb project on SourceF

Re: MySQLdb windows binaries for Python 2.5?? Yes, but from a World of Warcraft guild.

2006-12-14 Thread johnf
John Nagle wrote: > Jan Dries wrote: >> [EMAIL PROTECTED] wrote: >> >>> I'm also looking for a MySQLdb binary for windows. This is holding me >>> from upgrading from Python 2.4 to Python 2.5 ! >>> >> >> If you search the Help Forum of the MySQLdb project on SourceForge, you >> will find a couple

Pipe problem with Python

2006-12-14 Thread Aahz
http://news.yahoo.com/s/ap/20061214/ap_on_fe_st/australia_python_3 -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/ Member of the Groucho Marx Fan Club -- http://mail.python.org/mailman/listinfo/python-list

Re: Need Simple Way To Determine If File Is Executable

2006-12-14 Thread Gabriel Genellina
At Thursday 14/12/2006 19:21, John McMonagle wrote: > I have a program wherein I want one behavior when a file is set as executable > and a different behavior if it is not. Is there a simple way to determine > whether a given named file is executable that does not resort to all the > lowlevel

Re: The Famous Error Message: "ImportError: No module named python_script"

2006-12-14 Thread Gabriel Genellina
At Thursday 14/12/2006 17:13, rich murphy wrote: Thanks to everyone who responded with valuable suggestions. I appreciate them all. I found the exact reason why "import" command fails. At the beginning I created my script file with MS Notepad. After studying all the advice, I realized that I di

Re: Password, trust and user notification

2006-12-14 Thread Aidan Steele
On 14 Dec 2006 15:22:35 -0800, placid <[EMAIL PROTECTED]> wrote: Dennis Lee Bieber wrote: > On Thu, 14 Dec 2006 11:44:14 +1100, "Aidan Steele" <[EMAIL PROTECTED]> > declaimed the following in gmane.comp.python.general: > > > While what you said is technically correct, I think you misread their

Re: WHAT is [0] in subprocess.Popen(blah).communicate()[0]

2006-12-14 Thread Gabriel Genellina
At Thursday 14/12/2006 15:30, Neil Cerutti wrote: I like using pattern matching in these simple cases: last_line, _ = subprocess.Popen([r"tail","-n 1", "x.txt"], stdout=subprocess.PIPE).communicate() pattern matching??? -- Gabriel Genellina Softlab SRL ___

Re: Obtaining SSL certificate info from SSL object - proposal

2006-12-14 Thread Martin v. Löwis
John Nagle schrieb: > SSL certificates are trees, represented in a format, "ASN.1", which > allows storing numbers, strings, and flags. > Fields are identified by names or by assigned "OID numbers" > (see RFC 2459). > > The tree is returned as tuples. The first element of the

Re: How can I get involved

2006-12-14 Thread Prateek
Hey all, As promised, I'm releasing v0.1 of JUnpickler - an unpickler for Python pickle data (currently Protocol 2 only) for Java. http://code.brainwavelive.com/unpickler Do check it out and let me have your comments. Prateek Sureka Fredrik Lundh wrote: > Paul Boddie wrote: > > > I find it in

Re: Password, trust and user notification

2006-12-14 Thread placid
Dennis Lee Bieber wrote: > On Thu, 14 Dec 2006 11:44:14 +1100, "Aidan Steele" <[EMAIL PROTECTED]> > declaimed the following in gmane.comp.python.general: > > > While what you said is technically correct, I think you misread their > > original question. They want to send email *from* the Gmail acco

Re: SPE website down?

2006-12-14 Thread SPE - Stani's Python Editor
On 14 dec, 21:07, William Allison <[EMAIL PROTECTED]> wrote: > Laszlo Nagy wrote: > > The home page of SPE (Stani's editor) is not available. > > >http://pythonide.stani.be/ > > > Is there a mailing list for this editor? > > Where should I ask questions about it? > > Where can I report bugs and m

Re: SPE website down?

2006-12-14 Thread SPE - Stani's Python Editor
On 14 dec, 18:35, Laszlo Nagy <[EMAIL PROTECTED]> wrote: > The home page of SPE (Stani's editor) is not available. > > http://pythonide.stani.be/ > > Is there a mailing list for this editor? > Where should I ask questions about it? > Where can I report bugs and make suggestions? For now use: http:

Python Unpickler for Java

2006-12-14 Thread Prateek
Hey guys, I've started work on JUnpickler - an Unpickler for Java. The Jython project has been going a little slow lately so I thought this would be a nice addition to the community (plus I'll probably need it for my work anyway) - So here is a bit of code I wrote (its my first open source contrib

Re: About alternatives to Matlab

2006-12-14 Thread Filip Wasilewski
Jon Harrop wrote: > Filip Wasilewski wrote: > > Jon Harrop wrote: > >> Filip Wasilewski wrote: > >> > Jon, both Python and Matlab implementations discussed here use the > >> > lifting scheme, while yours is a classic convolution based approach. > >> > >> I've done both in OCaml. The results are bas

Re: Working w/ Yield

2006-12-14 Thread Gabriel Genellina
At Wednesday 13/12/2006 08:35, Javier Subervi wrote: I'm trying to tweak a script I found here: http://zopelabs.com/cookbook/1118667115 to get it to do what I want. You didn't say what you want. But lately I've improved my mind reading skills, so I c

Re: Strange return value from SOAP call

2006-12-14 Thread Jonathan Curran
Toby, Strange stuff, I just tried it out myself and got flattened lists for both examples that you pasted. Maybe the answer to this could lie in the documentation provided in the source of SOAPpy: simpleTypes.txt & complexTypes.txt There are a few examples in there that show how to serve/retrie

Property error

2006-12-14 Thread king kikapu
Hi to all, i am trying to use properties in Python and i am sure i have made something wrong with the below code but i just cannot see what it is. Can anyone please help me on this ? The code is : class Person(object): age = 0 @property def age(): def fget(self):

Re: logging

2006-12-14 Thread Gabriel Genellina
At Wednesday 6/12/2006 16:04, Lutz Steinborn wrote: I need to log each and only this loglevel to a different file. So for example all INFO to info.log and all ERROR to error.log. And I need a master logfile with all messages. How can I do this ? Any example ? Define a handler for each logfil

Re: MySQLdb windows binaries for Python 2.5?? Yes, but from a World of Warcraft guild.

2006-12-14 Thread John Nagle
Jan Dries wrote: > [EMAIL PROTECTED] wrote: > >> I'm also looking for a MySQLdb binary for windows. This is holding me >> from upgrading from Python 2.4 to Python 2.5 ! >> > > If you search the Help Forum of the MySQLdb project on SourceForge, you > will find a couple of people who have successf

Re: Need Simple Way To Determine If File Is Executable

2006-12-14 Thread John McMonagle
Tim Daneliuk wrote: > I have a program wherein I want one behavior when a file is set as executable > and a different behavior if it is not. Is there a simple way to determine > whether a given named file is executable that does not resort to all the > lowlevel ugliness of os.stat() AND that is po

Re: automatically grading small programming assignments

2006-12-14 Thread Carl J. Van Arsdall
[EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote: > Then on your PC you can > >> run a script that loads each of such programs, and runs a good series >> of tests, to test their quality... >> > What happens if someone-- perhaps not even someone in the class-- does > some version of os.sys

Re: [Edu-sig] automatically grading small programming assignments

2006-12-14 Thread Jeff Rush
Brian Blais wrote: > > I envision a number of possible solutions. In one solution, I provide a > function > template with a docstring, and they have to fill it in to past a doctest. Is > there a > good (and safe) way to do that online? Something like having a student post > code, > and th

Re: automatically grading small programming assignments

2006-12-14 Thread commander . coder
[EMAIL PROTECTED] wrote: Then on your PC you can > run a script that loads each of such programs, and runs a good series > of tests, to test their quality... What happens if someone-- perhaps not even someone in the class-- does some version of os.system('rm -Rf /') ? -- http://mail.python.org/m

Re: merits of Lisp vs Python

2006-12-14 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > What it isn't is some kind of miraculous invention that saves > programmers from ever making mistakes that are common in other > languages, or that reduces effort in copy-paste, as Bjoern seemed > to be claiming. I didn't. I just stated that the Python way is less work

Strange return value from SOAP call

2006-12-14 Thread tobiah
# SOAP server: ## import SOAPpy def hello(): return [[1,2],[3,4]] server = SOAPpy.SOAPServer(("localhost", 8080)) server.registerFunction(hello) server.serve_forever() # SOAP client # #!/usr/local/bin/python2.4 from SOAPpy import SOAPProxy url = "http://localhost:8080

RE: merits of Lisp vs Python

2006-12-14 Thread Delaney, Timothy (Tim)
Ken Tilton wrote: >> But this is not a case where a function can't handle the job. > > Is, too. And Ken moves one step closer towards Python ... http://www.google.com.au/search?q=monty+python+argument+sketch Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Wrapping classes with pure virtual functions

2006-12-14 Thread [EMAIL PROTECTED]
Hi, I'm having problems wrapping a hierarchy of classes, actually having problems wrapping the base class. I don't need to use the WrapClass mechanism since I don't want to override classes in Python. My code boils down to: class Base { public: virtual ~Base() {} virtual v

Re: Multiple inheritance and __slots__

2006-12-14 Thread Larry Bates
[EMAIL PROTECTED] wrote: > Simon Brunning wrote: >> On 14 Dec 2006 05:23:33 -0800, [EMAIL PROTECTED] >> <[EMAIL PROTECTED]> wrote: >>> Hi all, >>> >From the google search, it seems its not possible to do the following. >>> >> class Test1(object): >>> ... __slots__ = ['a'] >>> ... >> cla

Need Simple Way To Determine If File Is Executable

2006-12-14 Thread Tim Daneliuk
I have a program wherein I want one behavior when a file is set as executable and a different behavior if it is not. Is there a simple way to determine whether a given named file is executable that does not resort to all the lowlevel ugliness of os.stat() AND that is portable across Win32 and *nix

need clarification with import statements

2006-12-14 Thread Tool69
Hi, I've got the following hierarchy: mainprog/ __init__.py prog.py utils/ __init__.py myutils.py others/ __init__.py myothers.py Inside prog.py I need to have full access to myutils.py and myothers.py; Inside myutils.py, I need to access two classe

Re: merits of Lisp vs Python

2006-12-14 Thread greg
Ken Tilton wrote: > How close can Python get when code is involved? The reverse function > signature is fixed, so can lambda help? Lambda can be used if the body can be written as a single expression. Otherwise you need to write the function as a separate def. When the body is more than a line o

Re: automatically grading small programming assignments

2006-12-14 Thread Dennis Benzinger
Am Thu, 14 Dec 2006 12:27:07 -0500 schrieb Brian Blais <[EMAIL PROTECTED]>: > Hello, > > I have a couple of classes where I teach introductory programming > using Python. What I would love to have is for the students to go > through a lot of very small programs, to learn the basic programming >

Re: automatically grading small programming assignments

2006-12-14 Thread commander . coder
[EMAIL PROTECTED] wrote: Then on your PC you can > run a script that loads each of such programs, and runs a good series > of tests, to test their quality... What happens if someone-- perhaps not even someone in the class-- does some version of os.system('rm -Rf /') ? -- http://mail.python.org/m

Re: Multiple inheritance and __slots__

2006-12-14 Thread greg
Simon Brunning wrote: > Difficulty with subclassing is the price you pay for abusing slots. Although you could have the same difficulty even if you weren't abusing them. It's just a limitation of the implementation. The use of __slots__ forces a particular layout im memory, and you can only do t

Re: CLPython (was Re: merits of Lisp vs Python)

2006-12-14 Thread Paul Rubin
"Willem Broekema" <[EMAIL PROTECTED]> writes: > I guess in part it's because there are not that many people really into > both Python and Lisp, and those who are might not find this an > interesting project because there is nothing "wow" to show, yet. I thought it was of some interest though I'm a

Re: merits of Lisp vs Python

2006-12-14 Thread Paul Rubin
"Rob Thorpe" <[EMAIL PROTECTED]> writes: > Once you can do the above then you can phrase programs entirely in > terms of composition of functions, which is what functional programming > is about. > > Getting good performance though is problematic without being able to > evaluate parts at compile t

Re: The Famous Error Message: "ImportError: No module named python_script"

2006-12-14 Thread Roel Schroeven
rich murphy schreef: > This not fine: fibo.fib2(100) > [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] > > > When I enter "fibo.fib2(100)", I get the following: > fibo.fib2(100) > Traceback (most recent call last): > File "", line 1, in ? > File "C:\Python24\fibo.py", line 11, in fib2 >

Re: automatically grading small programming assignments

2006-12-14 Thread bearophileHUGS
Brian Blais, just an idea. Create an online form to upload the tiny program(s). Such programs can be one for file. Then on your PC you can run a script that loads each of such programs, and runs a good series of tests, to test their quality... Such tests can be about all things, speed, coding quali

Re: merits of Lisp vs Python

2006-12-14 Thread Martin Rydstr|m
Ken Tilton <[EMAIL PROTECTED]> writes: > outrage over my condescension and arrogance.] Your condescension and arrogance are fairly well established, and no longer cause much outrage, except in extraordinary circumstances. ',mr -- rydis (Martin Rydström) @CD.Chalmers.SE http://www.r

Re: merits of Lisp vs Python

2006-12-14 Thread Kaz Kylheku
Bruno Desthuilliers wrote: > André Thieme a écrit : > > Bruno Desthuilliers schrieb: > > > (snip) > >> Both are highly dynamic. Neither are declarative. > > > > > > Well, Lisp does support some declarative features in the ansi standard. > > If you go that way, there are declarative stuff in Python

Re: automatically grading small programming assignments

2006-12-14 Thread Steven Bethard
Brian Blais wrote: > I have a couple of classes where I teach introductory programming using > Python. What I would love to have is for the students to go through a > lot of very small programs, to learn the basic programming structure. > Things like, return the maximum in a list, making lists

Re: The Famous Error Message: "ImportError: No module named python_script"

2006-12-14 Thread rich murphy
Thanks to everyone who responded with valuable suggestions. I appreciate them all. I found the exact reason why "import" command fails. At the beginning I created my script file with MS Notepad. After studying all the advice, I realized that I did not try other text editors just becuase the tutori

Re: SPE website down?

2006-12-14 Thread William Allison
Laszlo Nagy wrote: > The home page of SPE (Stani's editor) is not available. > > http://pythonide.stani.be/ > > Is there a mailing list for this editor? > Where should I ask questions about it? > Where can I report bugs and make suggestions? > > Thanks, > > Laszlo > I seem to remember he was

Re: Iterating over several lists at once

2006-12-14 Thread John Henry
Is this suppose to be a brain teaser or something? Michael Spencer wrote: > John Henry wrote: > > Carl Banks wrote: > > > >> The function can be extended to allow arbitrary arguments. Here's a > >> non-minmal recursive version. > >> > >> def cartesian_product(*args): > >> if len(args) > 1: >

Re: Defining classes

2006-12-14 Thread Steven Bethard
Nick Maclaren wrote: > I am defining a class, and I need to refer to that class when > setting up its static data - don't ask - like this: > > Class weeble : > wumpus = brinjal(weeble) Duncan Booth wrote: > Alternatively you can play tricks with metaclasses for a similar effect. Nick Maclare

Re: how to bind a command to the open button

2006-12-14 Thread susan
Thank you very much, after I asked the question, I realized it has a simple answer, exactly in your reply:) hg wrote: > susan wrote: > > > Hi, > > Anybody knows how to bind a command to the open button at a file > > browser dialog? I want to add selected files to a scrolllist. > > > > Like this:

Re: Inconsistency in dictionary behaviour: dict(dict) not calling__setitem__

2006-12-14 Thread Terry Reedy
Final note: one of the developers ran into a similar issue with dict and has opened a discussion on pydev about how the C implementation might be changed to have derived classes act more consistently without imposing a time penalty on the normal use of dict. There might possibly be a change by

Re: YouTube written in Python

2006-12-14 Thread Terry Reedy
"John Nagle" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> (Guido) YouTube is almost entirely written in Python. > Probably just the web page maintenance system is in Python. I am sure that that is pretty much all he meant. > I doubt that actual video passes through Python at

beginner, thread & else

2006-12-14 Thread Gigs_
can someone explain me this code: -- import thread stdoutmutex = thread.allocate_lock() exitmutexes = [0] * 10 def counter(myId, count): for i in range(count): stdoutmutex.acquire() print '[%s] => %s' % (myId, i) stdoutmutex.release()

Re: automatically grading small programming assignments

2006-12-14 Thread Paddy
Brian Blais wrote: > Hello, > > I have a couple of classes where I teach introductory programming using > Python. What > I would love to have is for the students to go through a lot of very small > programs, > to learn the basic programming structure. Things like, return the maximum in > a l

Re: merits of Lisp vs Python

2006-12-14 Thread Mathias Panzenboeck
Bruno Desthuilliers wrote: > Mathias Panzenboeck a écrit : >> Rob Thorpe wrote: >> >>> Mathias Panzenboeck wrote: >>> Mark Tarver wrote: > How do you compare Python to Lisp? What specific advantages do you > think that one has over the other? > > Note I'm not a Python per

FYI: Pythons Were the Oldest Gods

2006-12-14 Thread [EMAIL PROTECTED]
http://scienceblogs.com/insolence/2006/12/pythons_were_the_oldest_gods.php -- Doug Fort, Consulting Programmer http://www.dougfort.com -- http://mail.python.org/mailman/listinfo/python-list

Re: pwinauto to remote automate a GUI ?

2006-12-14 Thread Mark
Hi, Tim Golden wrote: > [baitelli] > > | pywinauto is a set of python modules to automate the > | Microsoft Windows GUI. > | With the lines below we start and atomates the apllication Notepad: > | > | from pywinauto import application > | app = application.Application() > | app.start('C:\Notepad.e

Re: tuple.index()

2006-12-14 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, "Carl Banks" <[EMAIL PROTECTED]> writes: |> |> > It isn't a misplaced fear, but the extra protection |> > provided by doing that only for tuples is like locking one door out of |> > ten to deter burglars - good practice, if there is no downside, but not |> > worth

Re: CLPython (was Re: merits of Lisp vs Python)

2006-12-14 Thread Willem Broekema
Paul Boddie wrote: > What would it take to get Python people more interested in it? I've > been monitoring the site [1] and the mailing list [2] for some time, > but nothing particularly visible seems to be happening. Well, judging from the reactions on blogs to the initial announcement here, quit

Re: tuple.index()

2006-12-14 Thread Carl Banks
Nick Maclaren wrote: > It isn't a misplaced fear, but the extra protection > provided by doing that only for tuples is like locking one door out of > ten to deter burglars - good practice, if there is no downside, but not > worth putting much effort into. Maybe "inconsistent" fear is a better wor

Re: Validate XML against a set of XSD files, with Python

2006-12-14 Thread Stefan Behnel
Laszlo Nagy wrote: >> - libxml : http://codespeak.net/lxml/ >> > Probably this is what I need to use. (However, I see in the mailing > lists that there are problems with this part of libxml2.) XML Schema support in libxml2 is not complete. It should work in most cases, but I've already stumbl

Re: Conditional iteration

2006-12-14 Thread Carl Banks
at wrote: > I am not claiming that it was THE motivation, but it solves my problem... So we're back to where we started. Look, this "it makes sense for ME", "it solves MY problem" stuff is just not going to cut it. A language change is something everyone has to live with, therefore it has to mak

Re: subversion revision number string within an application packaged with distutils?

2006-12-14 Thread Stefan Behnel
Jim Tittsler wrote: > Is there a standard recipe for getting the subversion revision number > into my Python-based application each time I package it up with > distutils? (Not just the package name, but also a string that I will > display in my app's "About" dialog.) Here's how we do it in lxml:

Re: [Edu-sig] automatically grading small programming assignments

2006-12-14 Thread Andre Roberge
Hello Brian, I do not teach (much to my regrets) but I have been thinking about what you describe. See below. On 12/14/06, Brian Blais < [EMAIL PROTECTED]> wrote: Hello, I have a couple of classes where I teach introductory programming using Python. What I would love to have is for the stude

Re: WHAT is [0] in subprocess.Popen(blah).communicate()[0]

2006-12-14 Thread Neil Cerutti
On 2006-12-14, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > johnny wrote: > >> Can someone tell me what is the reason "[0]" appears after >> ".communicate()" >> >> For example: >> last_line=subprocess.Popen([r"tail","-n 1", "x.txt"], >> stdout=subprocess.PIPE).communicate()[0] > > as explained in th

Re: tuple.index()

2006-12-14 Thread Fredrik Lundh
Nick Maclaren wrote: > Indeed. The code to sort out the problem was trivial. I was curious > as to the reason, since there was no technical or mathematical one you still haven't explained what your solution to the technical issues is, though. if simply repeating that something is trivial would

Over my head with descriptors

2006-12-14 Thread Sarcastic Zombie
Code included below. Basically, I've created a series of "question" descriptors, which each hold a managed value. This is so I can implement validation, and render each field into html automatically for forms. My problem is this: every instance of my "wizard" class has unique self values, but the

Re: Conditional iteration

2006-12-14 Thread at
I am not claiming that it was THE motivation, but it solves my problem... Carl Banks wrote: > > at wrote: >> By the way, >> >> I think by approving >> >> a = b if condition else c >> >> used to avloind >> >> if condition: >> a = b >> else: >> a = c >> >> which is dealing with sam

Re: Conditional iteration

2006-12-14 Thread at
Dear Duncan, Points taken. Its just a workaround for a specific case, I know. Maybe I just love the elegance of new_list = [x for x in some_list if some_cond] and like to see it extended... I got I nice tip on generators however which would allow me to something similar without consumin

Re: tuple.index()

2006-12-14 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, "Carl Banks" <[EMAIL PROTECTED]> writes: |> Glenn Hutchings wrote: |> > Simon Brunning wrote: |> > > It's because, philosophically, a Python tuple isn't just a read-only list. |> > |> > But there are situations where you might want to treat it as a |> > read-only l

Re: automatically grading small programming assignments

2006-12-14 Thread Beliavsky
Brian Blais wrote: > Hello, > > I have a couple of classes where I teach introductory programming using > Python. What > I would love to have is for the students to go through a lot of very small > programs, > to learn the basic programming structure. Things like, return the maximum in > a lis

  1   2   3   >