Re: A replacement for lambda

2005-07-29 Thread Paul Rubin
James Richards <[EMAIL PROTECTED]> writes: > Personally, I can't recall any decent programmer I know who objects > to actually writing out a variable name. In fact, I don't know a > single "real" programmer (this is one who writes programs he intends > to look at again in, say, 3 weeks) who doesn'

Re: Python-cgi or Perl-cgi script doubt

2005-07-29 Thread EP
Prabahar wrote: >I want to know difference between > Python-cgi and Perl-cgi and also I want > to which one is efficient from the performance. The difference between a cgi program written in Perl and a cgi program written in Python is the choice of programming language. Both work quite

Re: On fighting fire with fire...

2005-07-29 Thread mustafa
Steven D'Aprano wrote: > On Thu, 28 Jul 2005 15:23:46 -0500, Rocco Moretti wrote: > > >>Professionals (and even decent hobbyists) don't >>escalate flame wars, even unintentionally. > > > You don't get out much, do you? *wink* > > If your comment is meant to be _prescriptive_ rather than _desc

HTML Scraping??

2005-07-29 Thread mustafa
anyone know some good reliable html scraping (with python) tutorials. i have looked around and found a few. one uses urllib2 and beautifull soap modules for scraping and parsing http://www.dalkescientific.com/writings/diary/archive/2005/04/21/screen_scraping.html and the other uyses mechanize, cli

Re: A replacement for lambda

2005-07-29 Thread Tim Roberts
Scott David Daniels <[EMAIL PROTECTED]> wrote: > >What kind of shenanigans must a parser go through to translate: > < > >this is the comparison of two functions, but it looks like a left- >shift on a function until the second with is encountered. Then >you need to backtrack to the shift and co

Aiksaurus interface?

2005-07-29 Thread James Richards
Major big apologies if this has been covered to death before. It's been a few years since I played with these two technologies. I seem to recall a python wrapper over aiksaurus. I can't find it now. (Or maybe it's just my own stupidity. That's been known to happen :-/). Is there a project/wrap

Re: To thread or not to thread

2005-07-29 Thread James Richards
On 2005-07-28, Sidd <[EMAIL PROTECTED]> wrote: > Hello, > I was recently reading an article on threading in python and I > came across Global Interpreter Lock,now as a novince in python I was > cusrious about > > 1.Is writing a threaded code in python going to perform well than a > normal pyt

Python-cgi or Perl-cgi script doubt

2005-07-29 Thread praba kar
Dear All, I want to know difference between Python-cgi and Perl-cgi and also I want to which one is efficient from the performance. regards Prabahar ___ Too much spam in your inbox? Yahoo! Mail gives you the best spam p

Re: A replacement for lambda

2005-07-29 Thread James Richards
On 2005-07-30, Scott David Daniels <[EMAIL PROTECTED]> wrote: > Christopher Subich wrote: >> g = >> g(1) == 1 >> >> Basically, I'd rewrite the Python grammar such that: >> lambda_form ::= "<" expression "with" parameter_list ">" >> >> Biggest change is that parameter_list is no longer optional,

Selection, picking with PyOpenGL?

2005-07-29 Thread Erik Max Francis
I was interesting in adding selection and hit testing to ZOE, and was looking at the PyOpenGL wrappers' handling of selection and picking. I see glSelectBuffer to specify the size of the buffer, and glRenderMode properly returns the number of hits when put back into GL_RENDER mode, but I don't

Re: Path inherits from basestring again

2005-07-29 Thread Peter Hansen
NickC wrote: > I'm usually not much of a purist, but C++ has convinced me that > overloading an operator to mean something entirely unrelated to its > mathematical meaning can be very unwise. Me too. In general. I've yet to overload a single operator that way in years of writing Python code, th

Re: Ten Essential Development Practices

2005-07-29 Thread Jorge Godoy
Michael Hoffman wrote: > In that case, I think he just wasted a lot of time in the article, and > would have been better off saying "use Getopt::Long." This is why I think he was more concerned with design than implementation. -- Jorge Godoy <[EMAIL PROTECTED]> -- http://mail.python.org

Re: Hiding

2005-07-29 Thread Jay
thanks for the great info and urls, i have downloaded the pymedia module and playing around with it now. Thx alot -- http://mail.python.org/mailman/listinfo/python-list

Re: Ten Essential Development Practices

2005-07-29 Thread Michael Hoffman
Jorge Godoy wrote: > Michael Hoffman wrote: > > >>True, but a lot of his point *is* parsing input from the command line. >>Consider the following points paraphrased from his article: >> >>* Don't mix multiple ways of specifying options. (Solved by optparse) >>* If a flag expects an associated val

Re: ANN: PyDev 0.9.7 released

2005-07-29 Thread Jorge Godoy
Rocky Burt wrote: > Installing fresh PyDev 0.9.7 onto eclipse 3.1 (no prior PyDev installed) > yields the following error when opening a python file. Seems like a > simple enough error... the PyEdit class seems to be present. I had the same problems today. Then I read the requisites: Java 1.5.0

RE: [path-PEP] Path inherits from basestring again

2005-07-29 Thread Tony Meyer
>> (Those who are offended by sweeping generalisations should >> ignore this next bit) [...generalisation bit snipped...] > This is not only bullshit, it's elitist bullshit. "Windows users are > more clueless than users of posix systems." Pfui. Prove it > or withdraw it. Sigh. I guess you di

Re: [path-PEP] Path inherits from basestring again

2005-07-29 Thread Ivan Van Laningham
Hi All-- Tony Meyer wrote: > > So far, there have been various statements that look like +0 for __div__, > but no-one with a +1. (And I've said this a couple of times now, which > really is just trolling for a +1 from someone). > > > It's not a question of saving characters, but readability whi

Re: writing a web client

2005-07-29 Thread gene tani
Here: http://diveintopython.org/http_web_services/index.html#oa.divein Here: Cookbook rel 2, and: http://aspn.activestate.com/ASPN/Cookbook/Python?kwd=Web Here:other really good py intros which cover 2.2 / urllib (maybe 2.3, I don't have them with me), but examples should all not give deprecation

Re: ANN: PyDev 0.9.7 released

2005-07-29 Thread Rocky Burt
Installing fresh PyDev 0.9.7 onto eclipse 3.1 (no prior PyDev installed) yields the following error when opening a python file. Seems like a simple enough error... the PyEdit class seems to be present. java.lang.ClassNotFoundException: org.python.pydev.editor.PyEdit at org.eclipse.osgi.fr

Re: A replacement for lambda

2005-07-29 Thread Scott David Daniels
Christopher Subich wrote: > g = > g(1) == 1 > > Basically, I'd rewrite the Python grammar such that: > lambda_form ::= "<" expression "with" parameter_list ">" > > Biggest change is that parameter_list is no longer optional, so > zero-argument expr-comps would be written as , which makes > a b

RE: [path-PEP] Path inherits from basestring again

2005-07-29 Thread Tony Meyer
> We're talking at this point about how Path should work, not > whether it's preferable to os.path.join, even though that was > really the point of Reinhard's original post. That's not what I'm talking about. I'm talking about whether __div__ should be a shortcut to joinwith, or whether users sh

Re: A replacement for lambda

2005-07-29 Thread Paul Rubin
Christopher Subich <[EMAIL PROTECTED]> writes: > My personal favourite is to replace "lambda" entirely with an > "expression comprehension", using < and > delimeters. But how does that let you get more than one expression into the anonymous function? -- http://mail.python.org/mailman/listinfo/pyt

Re: A replacement for lambda

2005-07-29 Thread Christopher Subich
Mike Meyer wrote: > My choice for the non-name token is "@". It's already got magic > powers, so we'll give it more rather than introducing another token > with magic powers, as the lesser of two evils. Doesn't work. The crux of your change isn't introducing a meaning to @ (and honestly, I prefe

Re: Path inherits from basestring again

2005-07-29 Thread NickC
[Re: how to get at the base class] Do you really want to have a "only works for Path" way to get at the base class, rather than using the canonical Path.__bases__[0]? How about a new property in the os.path module instead? Something like os.path.path_type. Then os.path.path_type is unicode if an

Re: Block-structured resource handling via decorators

2005-07-29 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > > When handling resources in Python, where the scope of the resource is > > known, there seem to be two schools of thought: > > (1) Explicit: ... > > (2) Implicit: let the GC handle it. > > The only cases I see the first school of thought is when the resour

Re: Block-structured resource handling via decorators

2005-07-29 Thread Mike Meyer
"John Perks and Sarah Mount" <[EMAIL PROTECTED]> writes: > When handling resources in Python, where the scope of the resource is > known, there seem to be two schools of thought: > > (1) Explicit: > f = open(fname) > try: > # ... > finally: > f.close() > > (2) Implicit: let the GC handle i

Re: Path inherits from basestring again

2005-07-29 Thread NickC
[Re: alternatives to overloading '/'] Is there a reason the Path constructor is limited to a single argument? If it allowed multiple arguments, the following would seem very straightforward: p = Path(somePath, user.getFolder(), 'archive', oldPath + ".bak") I'm usually not much of a purist, but C

Re: Block-structured resource handling via decorators

2005-07-29 Thread Neil Hodgson
John Perks: > When handling resources in Python, where the scope of the resource is > known, there seem to be two schools of thought: > ... This is part of what PEP 343 addresses: http://www.python.org/peps/pep-0343.html Neil -- http://mail.python.org/mailman/listinfo/python-list

Re: xml-object mapping

2005-07-29 Thread uche . ogbuji
"I am looking for an xml-object mapping tool ('XML Data Binding-design time product') where I can define the mapping rules in 'binding files' and the parser is generated automatically. Similar to the solution of Dave Kuhlman (http://www.rexx.com/~dkuhlman/ generateDS.html) where the mapping is def

Re: Suggestions for Python XML library which can search and insert

2005-07-29 Thread uche . ogbuji
"I'm looking for a library that can search through an XML document tree, locate an element by attribute (ideally this can be done through XPath), and insert an element (as its child). Simple? Yes? ...but the code I've seen so far which does this uses 'nested for loops' for trees which are relative

Re: On fighting fire with fire...

2005-07-29 Thread Steven D'Aprano
On Thu, 28 Jul 2005 17:24:06 -0400, Asad Habib wrote: > Well, even if you are a hobbyist, that does not excuse you from being > civil. After all, we are all humans beings that deserve to be treated with > respect. Professional, hobbyist, vagabond, ogre, instigator, troll ... > THERE IS NO EXCUSE .

Re: On fighting fire with fire...

2005-07-29 Thread Steven D'Aprano
On Thu, 28 Jul 2005 15:23:46 -0500, Rocco Moretti wrote: > Professionals (and even decent hobbyists) don't > escalate flame wars, even unintentionally. You don't get out much, do you? *wink* If your comment is meant to be _prescriptive_ rather than _descriptive_, I don't entirely agree. Flame

urllib2 bug?

2005-07-29 Thread bob sacamano
Certain pages cause urllib2 to go into an infinite loop when using readline(), but everything works fine if read() is used instead. Is this a bug or am I missing something simple? import urllib2 url = 'http://www.naylamp.com' f = urllib2.urlopen(url) i = 0 #this works fine when uncommented #pr

Block-structured resource handling via decorators

2005-07-29 Thread John Perks and Sarah Mount
When handling resources in Python, where the scope of the resource is known, there seem to be two schools of thought: (1) Explicit: f = open(fname) try: # ... finally: f.close() (2) Implicit: let the GC handle it. I've come up with a third method that uses decorators to achieve a useful

A replacement for lambda

2005-07-29 Thread Mike Meyer
I know, lambda bashing (and defending) in the group is one of the most popular ways to avoid writing code. However, while staring at some Oz code, I noticed a feature that would seem to make both groups happy - if we can figure out how to avoid the ugly syntax. This proposal does away with the wel

Re: Async PySerial (was Re: pySerial Windows write problem)

2005-07-29 Thread Peter Hansen
phil wrote: > I use PySerial in a 16 line data collection system > with LOTS of threads, and yes am frustrated by read(). > This sounds excellent, keep us updated. > > BTW, haven't done any event driven Python except Tkinter. > Would this a class library which would let you > define an event and

Re: multiple inheritance super()

2005-07-29 Thread Mike Meyer
"Michele Simionato" <[EMAIL PROTECTED]> writes: > adding methods on the fly and metaclasses could live pretty well > without > multiple inheritance. There would be no real loss > of power and hopefully less monstruosities such > a Zope 2. But maybe this is just wishful thinking ... Um, no real lo

Re: can list comprehensions replace map?

2005-07-29 Thread Andrew Dalke
Peter Otten wrote: > Seems my description didn't convince you. So here's an example: Got it. In my test case the longest element happened to be the last one, which is why it didn't catch the problem. Thanks. Andrew [EMAIL PROTECTED

Re: writing a web client

2005-07-29 Thread Mike Meyer
"Fuzzyman" <[EMAIL PROTECTED]> writes: > Ajar wrote: >> I want to write a program which will automatically login to my ISPs >> website, retrieve data and do some processing. Can this be done? Can >> you point me to any example python programs which do similar things? >> >> Regards, >> Ajar > > Ver

Re: Adding code and methods to a class dynamically

2005-07-29 Thread Peter Hansen
Sarir Khamsi wrote: > Peter Hansen <[EMAIL PROTECTED]> writes: >>I'm not sure what "completion" means in this case, and I'm not aware >>of any "command-line completion" support in cmd.Cmd though it may well >>be there, so I can't say. Certainly there is nothing in any way >>different about the new

Re: Hiding

2005-07-29 Thread Peter Hansen
Jason Drew wrote: > Also, I think > using file("C:\file.txt") is now preferred to open("C:\file.txt"). As others have noted, "open" is preferred as the method for opening files, while "file" is the _type_ involved, for testing or subclassing or what-have-you. But neither file("C:\file.txt") nor

Re: Ten Essential Development Practices

2005-07-29 Thread Peter Hansen
Dan Sommers wrote: > [EMAIL PROTECTED] (Aahz) wrote: >>Dan Sommers <[EMAIL PROTECTED]> wrote: >>>Was Tim writing about developing Python itself, or about developing >>>other programs with Python? > >>Yes. > > It was a rhetorical question. :-) That's all right... Aahz gave a rhetorical answer.

Re: Advanced concurrancy

2005-07-29 Thread Michael Sparks
Peter Tillotson wrote: > Hi, > > I'm looking for an advanced concurrency module for python and don't seem > to be able to find anything suitable. Does anyone know where I might > find one? I know that there is CSP like functionality built into > Stackless but i'd like students to be able to use a

Re: Adding code and methods to a class dynamically

2005-07-29 Thread Sarir Khamsi
Peter Hansen <[EMAIL PROTECTED]> writes: > I'm not sure what "completion" means in this case, and I'm not aware > of any "command-line completion" support in cmd.Cmd though it may well > be there, so I can't say. Certainly there is nothing in any way > different about the new attribute created by

Re: PEP on path module for standard library

2005-07-29 Thread Mike Orr
Michael Hoffman wrote: > I use path in more of my modules and scripts than any other third-party > module, and I know it will be very helpful when I no longer have to > worry about deploying it. Same here. An object-oriented path module is extremely useful, and makes one's code much less cluttere

Re: Hiding

2005-07-29 Thread Benji York
Steven Bethard wrote: > So open("C:\file.txt") is still fine I think it is more like it is recommended, not just OK. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Hiding

2005-07-29 Thread Steven Bethard
Jason Drew wrote: > Also, I think using file("C:\file.txt") is now preferred > to open("C:\file.txt"). Guido has said he wants to keep open() around as the way to open a file-like object, with the theory that in the future open might also support opening non-files (e.g. urls). So open("C:\file.

Re: Filtering out non-readable characters

2005-07-29 Thread Steven Bethard
Steve Holden wrote: > >>> tt = "".join([chr(i) for i in range(256)]) Or: tt = string.maketrans('', '') STeVe -- http://mail.python.org/mailman/listinfo/python-list

Re: Ten Essential Development Practices

2005-07-29 Thread Jorge Godoy
Michael Hoffman wrote: > True, but a lot of his point *is* parsing input from the command line. > Consider the following points paraphrased from his article: > > * Don't mix multiple ways of specifying options. (Solved by optparse) > * If a flag expects an associated value, allow an optional = be

Help with Asyncore

2005-07-29 Thread Seth Nielson
Hello, I am using Asyncore.dispatcher around a socket (well call the wrapped version a channel). This channel is passed around to other objects. These objects call "send" on the channel. My question is, what do you do for "writable" and "handle_write"? Those seemed designed for channel-internal b

Re: Filtering terminal commands on linux

2005-07-29 Thread Lonnie Princehouse
Firstly, there's probably a better way to do whatever you're trying to do w.r.t cd/dvd burning. I'm not familiar with gear, but its webpage lists "Batch file scripting capability" as a feature, which suggests that you might be able to do what you want without parsing output intended for humans. T

Re: Hiding

2005-07-29 Thread Larry Bates
I can say with some certainty that opening a "music file" with open won't launch media player. If rather, you do os.system('musicfile.mp3') it will launch whatever application is associated with the file type .mp3. You can either automate Windows Media player or use pymedia to play such files. H

Re: Hiding

2005-07-29 Thread Jason Drew
Well, using the open function in Python doesn't launch any application associated with the file (such as Media Player). It just makes the contents of the file accessible to your Python code. Also, I think using file("C:\file.txt") is now preferred to open("C:\file.txt"). To answer the specific que

Seeking Python expertise...

2005-07-29 Thread Amanda Arnett
Hi, I found out about your Python community and thought you may be able to help me out.  I am supporting an elite group of traders (more like the Who's Who on Wall Street).  We are building algorithmic trading models to analyze market movements, economic indicators, and various factors to pre

Re: can list comprehensions replace map?

2005-07-29 Thread Peter Otten
Scott David Daniels wrote: > Can I play too? Not unless you buy the expensive but good-looking c.l.py gaming license which is only available trough me :) > How about: > import itertools > > def fillzip(*seqs): > def Nones(countactive=[len(seqs)]): > countactive

Re: can list comprehensions replace map?

2005-07-29 Thread Peter Otten
Andrew Dalke wrote: > Me: >>> Could make it one line shorter with >> >>> from itertools import chain, izip, repeat >>> def fillzip(*seqs): >>> def done_iter(done=[len(seqs)]): >>> done[0] -= 1 >>> if not done[0]: >>> return [] >>> return repeat(None) >>>

Dr. Dobb's Python-URL! - weekly Python news and links (Jul 29)

2005-07-29 Thread Simon Brunning
QOTW: "Guido has marked the trail; don't ignore the signs unless you really know where you're going." - Raymond Hettinger 'Proverbs 28:14 JPS "Happy is the man that feareth alway; but he that hardeneth his heart shall fall into evil." Obviously an exhortation to not ignore raised exceptions with "

Re: can list comprehensions replace map?

2005-07-29 Thread Andrew Dalke
Scott David Daniels wrote: > Can I play too? How about: Sweet! Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: can list comprehensions replace map?

2005-07-29 Thread Andrew Dalke
Me: >> Could make it one line shorter with > >> from itertools import chain, izip, repeat >> def fillzip(*seqs): >> def done_iter(done=[len(seqs)]): >> done[0] -= 1 >> if not done[0]: >> return [] >> return repeat(None) >> seqs = [chain(seq, done_iter()

Hiding

2005-07-29 Thread Jay
Well, im not no expert on the python programming language but i just wanted to know if there was a quick way to hide certain things when programming in python. Such as, i wanted some music or sound effects with my python program. So, i type... print "Music is by blah blah" music-file = open(file c

Re: writing a web client

2005-07-29 Thread Jay
thats pretty cool, could someone post a example program of a python web-based program? -- http://mail.python.org/mailman/listinfo/python-list

Re: writing a web client

2005-07-29 Thread Jay
thats pretty cool, could someone post a example program of a python web-based program? -- http://mail.python.org/mailman/listinfo/python-list

Re: Ten Essential Development Practices

2005-07-29 Thread Michael Hoffman
Jorge Godoy wrote: > Michael Hoffman wrote: > > >>He spends so much space on "Create Consistent Command-Line Interfaces," >>a section that, in Python, could be replaced with a simple "Use optparse." > > > In Perl there's also the equivalent of optparse, but where does it guarantee > that you'll

Re: Wheel-reinvention with Python (was: Ten Essential DevelopmentPractices)

2005-07-29 Thread en.karpachov
On Fri, Jul 29, 2005 at 01:18:10PM -0400, Jeremy Moles wrote: > On Fri, 2005-07-29 at 17:59 +0200, Torsten Bronger wrote: > > one thinks "well, perfect, I have the choice between four > > Four? > > 1. wx > 2. PyGTK > 3. Tk (Are you including this one even?) > 4. ??? Well, QT at least. And sure

Re: Wheel-reinvention with Python (was: Ten Essential Development Practices)

2005-07-29 Thread Jeremy Moles
On Fri, 2005-07-29 at 14:19 -0300, Jorge Godoy wrote: > Jeremy Moles wrote: > > > Four? > > > > 1. wx > > 2. PyGTK > > 3. Tk (Are you including this one even?) > > 4. ??? > > PyQt / PyKDE. Ah! Can't believe I forgot that one! :) > > Of the few I can think of, only one would qualify as great. :

Re: Ten Essential Development Practices

2005-07-29 Thread Dan Sommers
On 29 Jul 2005 07:45:33 -0700, [EMAIL PROTECTED] (Aahz) wrote: > In article <[EMAIL PROTECTED]>, > Dan Sommers <[EMAIL PROTECTED]> wrote: >> >> Was Tim writing about developing Python itself, or about developing >> other programs with Python? > Yes. > (C'mon, didja really expect any other answ

Re: Wheel-reinvention with Python (was: Ten Essential Development Practices)

2005-07-29 Thread Jorge Godoy
Jeremy Moles wrote: > Four? > > 1. wx > 2. PyGTK > 3. Tk (Are you including this one even?) > 4. ??? PyQt / PyKDE. > Of the few I can think of, only one would qualify as great. :) The fourth one? ;-) -- Jorge Godoy <[EMAIL PROTECTED]> -- http://mail.python.org/mailman/listinfo/python-

Re: Ten Essential Development Practices

2005-07-29 Thread Jorge Godoy
Michael Hoffman wrote: > He spends so much space on "Create Consistent Command-Line Interfaces," > a section that, in Python, could be replaced with a simple "Use optparse." In Perl there's also the equivalent of optparse, but where does it guarantee that you'll use consistent name options and de

Re: can list comprehensions replace map?

2005-07-29 Thread Peter Otten
Andrew Dalke wrote: > Peter Otten wrote: >> Combining your "clever" and your "elegant" approach to something fast >> (though I'm not entirely confident it's correct): >> >> def fillzip(*seqs): >> def done_iter(done=[len(seqs)]): >> done[0] -= 1 >> if not done[0]: >>

Re: Wheel-reinvention with Python (was: Ten Essential Development Practices)

2005-07-29 Thread Jeremy Moles
On Fri, 2005-07-29 at 17:59 +0200, Torsten Bronger wrote: > Hallöchen! > > Michael Hoffman <[EMAIL PROTECTED]> writes: > > > Dark Cowherd wrote: > > > >> GUI, Web development, Application Framework - it is shambles. > > > > Yeah, I agree. When I finally make that GUI application I still > > don't

Re: can list comprehensions replace map?

2005-07-29 Thread Scott David Daniels
Peter Otten wrote: > def fillzip(*seqs): > def done_iter(done=[len(seqs)]): > done[0] -= 1 > if not done[0]: > return > while 1: > yield None > seqs = [chain(seq, done_iter()) for seq in seqs] > return izip(*seqs) Can I play too? How abou

Re: Ten Essential Development Practices

2005-07-29 Thread Calvin Spealman
On 7/29/05, Dark Cowherd <[EMAIL PROTECTED]> wrote: > I am new to Python. I tried it out and think it is fantastic. Congrats and have fun learning all there is to learn. > I really loved this from import this statements: > > There should be one-- and preferably only one --obvious way to do it. >

Re: Wheel-reinvention with Python (was: Ten Essential Development Practices)

2005-07-29 Thread Calvin Spealman
The choice is GUI toolkits is largely seperate from Python. Consider that they are just bindings to libraries that are developed completely seperate of the language. GUI is should be seperate from the language, and thus not bound to same expectations and desires as elements of the language itself.

Re: Wheel-reinvention with Python

2005-07-29 Thread Michael Hoffman
Torsten Bronger wrote: > Hallöchen! > > Michael Hoffman <[EMAIL PROTECTED]> writes: > > >>Dark Cowherd wrote: >> >> >>>GUI, Web development, Application Framework - it is shambles. >> >>Yeah, I agree. When I finally make that GUI application I still >>don't know whether I am going to use wx or P

Re: multiple inheritance super()

2005-07-29 Thread Michele Simionato
Sion Arrowsmith > That way lies Java well, no, a dynamic language such as Python with the possibility of adding methods on the fly and metaclasses could live pretty well without multiple inheritance. There would be no real loss of power and hopefully less monstruosities such a Zope 2. But maybe th

Re: On fighting fire with fire...

2005-07-29 Thread Dr. Who
I was explaining the difference between irony and sarcasm to my daughter just the other day. It was nice of Asad to provide us with such a besutiful example. Not that I'm sure that was his intent... Jeff -- http://mail.python.org/mailman/listinfo/python-list

Wheel-reinvention with Python (was: Ten Essential Development Practices)

2005-07-29 Thread Torsten Bronger
Hallöchen! Michael Hoffman <[EMAIL PROTECTED]> writes: > Dark Cowherd wrote: > >> GUI, Web development, Application Framework - it is shambles. > > Yeah, I agree. When I finally make that GUI application I still > don't know whether I am going to use wx or PyGTK. I agree, too, although I can onl

Re: Ten Essential Development Practices

2005-07-29 Thread Daniel Dittmar
Dark Cowherd wrote: > There should be one-- and preferably only one --obvious way to do it. > > But this not true of Python. > GUI, Web development, Application Framework - it is shambles. It is so That's because there is no *obvious* way to do these. > -Quote - Phillip J. Eby from dirtsimple.o

Re: can list comprehensions replace map?

2005-07-29 Thread Andrew Dalke
Peter Otten wrote: > Combining your "clever" and your "elegant" approach to something fast > (though I'm not entirely confident it's correct): > > def fillzip(*seqs): > def done_iter(done=[len(seqs)]): > done[0] -= 1 > if not done[0]: > return > while 1: >

Re: Ten Essential Development Practices

2005-07-29 Thread Michael Hoffman
Dark Cowherd wrote: > GUI, Web development, Application Framework - it is shambles. Yeah, I agree. When I finally make that GUI application I still don't know whether I am going to use wx or PyGTK. > Is there some place to discuss topics like this? Is this the right place? Sure, although you m

Re: Ten Essential Development Practices

2005-07-29 Thread Dark Cowherd
I am new to Python. I tried it out and think it is fantastic. I really loved this from import this statements: There should be one-- and preferably only one --obvious way to do it. But this not true of Python. GUI, Web development, Application Framework - it is shambles. It is so frustrating fo

Re: Ten Essential Development Practices

2005-07-29 Thread Bill Mill
> although, as some argue, it's > possible [GvR] thinks in base 9.5, that just doesn't seem Pythonic to me. +1 QOTW Peace Bill Mill [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Ten Essential Development Practices

2005-07-29 Thread Aahz
In article <[EMAIL PROTECTED]>, Dan Sommers <[EMAIL PROTECTED]> wrote: > >Was Tim writing about developing Python itself, or about developing >other programs with Python? Yes. (C'mon, didja really expect any other answer?) -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft

Re: On fighting fire with fire...

2005-07-29 Thread Rocco Moretti
Asad Habib wrote: > Well, even if you are a hobbyist, that does not excuse you from being > civil. After all, we are all humans beings that deserve to be treated with > respect. Professional, hobbyist, vagabond, ogre, instigator, troll ... > THERE IS NO EXCUSE ... please treat others with respect.

Re: Ten Essential Development Practices

2005-07-29 Thread Tim Peters
[Dan Sommers] > Ok, not universal. But as usual, Zen is not easily nailed to a tree. > > Was Tim writing about developing Python itself, or about developing > other programs with Python? Tim was channeling Guido, and that's as far as our certain knowledge can go. It _seems_ reasonable to believ

Re: poplib.POP3.list() returns extra value?

2005-07-29 Thread Steve Greenland
According to Jeff Epler <[EMAIL PROTECTED]>: > I'd consider it a doc bug too. If you feel comfortable doing it, dive > in and improve the documentation of poplib. Submitting a patch to the > patch tracker on sf.net/projects/python is probably the best way to do > this, if you have the necessary

Re: Ten Essential Development Practices

2005-07-29 Thread Tim Peters
[Steve Holden] >> If I canpoint out the obvious, the output from "import this" *is* >> headed "The Zen of Python", so clearly it isn;t intended to be >> universal in its applicability. [Michael Hudson] > It's also mistitled there, given that it was originally posted as '19 > Pythonic Theses' and n

Re: Filtering out non-readable characters

2005-07-29 Thread Steve Holden
Adriaan Renting wrote: > def StripNoPrint(self, S): > from string import printable > return "".join([ ch for ch in S if ch in printable ]) > > > Adriaan Renting| Email: [EMAIL PROTECTED] > ASTRON | Phone: +31 521 595 217 > P.O. Box 2 | GSM: +3

Re: Friend wants to learn python

2005-07-29 Thread Ron Stephens
EnderLocke wrote: > I have a friend who wants to learn python programming. I learned off > the internet and have never used a book to learn it. What books do you > recommend? > > Any suggestions would be appreciated. I have just uploaded a podcast specifically about which tutorials and books might

Re: functions without parentheses

2005-07-29 Thread Josef Meile
Steven D'Aprano wrote: > On Fri, 29 Jul 2005 06:37:52 +, Bengt Richter wrote: > > >>I suggested in a previous thread that one could support such a syntax by >>supporting an invisible binary operator between two expressions, so that >>examine "string" translates to examine.__invisbinop__("stri

Re: writing a web client

2005-07-29 Thread gene tani
fuzzy's urllib2 info is excellent. The other way peopel snarf stuff over HTTP and FTP is using 'wget' or 'libcurl'. THere's http://pycurl.sourceforge.net/ -- http://mail.python.org/mailman/listinfo/python-list

ANN: python-ldap-2.0.9

2005-07-29 Thread Michael Ströder
Find a new release of python-ldap: http://python-ldap.sourceforge.net/ python-ldap provides an object-oriented API to access LDAP directory servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for that purpose. Additionally it contains modules for other LDAP-related stuff (e.g. p

Re: why functions in modules need 'global foo' for integer foo but not dictionary foo?

2005-07-29 Thread John Roth
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > At top of a module I have an integer like so... > > foo = 4 > > In a function in that module I know I need to do 'global foo' to get at > the value 4. Actually, you don't need a "global foo" statement to _access_ the value. You do need

Re: Async PySerial (was Re: pySerial Windows write problem)

2005-07-29 Thread phil
I use PySerial in a 16 line data collection system with LOTS of threads, and yes am frustrated by read(). This sounds excellent, keep us updated. BTW, haven't done any event driven Python except Tkinter. Would this a class library which would let you define an event and a handler? Do you have a

Re: writing a web client

2005-07-29 Thread Fuzzyman
Ajar wrote: > I want to write a program which will automatically login to my ISPs > website, retrieve data and do some processing. Can this be done? Can > you point me to any example python programs which do similar things? > > Regards, > Ajar Very easily. Have a look at my article on the ``urlli

Re: os._exit vs. sys.exit

2005-07-29 Thread Peter Hansen
Bryan wrote: > Thanks for the clarifications. One more question, can I catch this > exception in my main thread and then do another sys.exit() to kill the whole > process? Not as such. Exceptions can be caught only in the thread in which they are raised. There are tricky techniques to change

Async PySerial (was Re: pySerial Windows write problem)

2005-07-29 Thread Peter Hansen
Neil Benn wrote: > PySerial doesn;t have any kind of event firing to notify you when data > is available. The way I get round this is to have a loop polling (in a > seperate thread) to see if any data is available (it's a method on the > interface), then read all the data in and fire this off t

writing a web client

2005-07-29 Thread Ajar
I want to write a program which will automatically login to my ISPs website, retrieve data and do some processing. Can this be done? Can you point me to any example python programs which do similar things? Regards, Ajar -- http://mail.python.org/mailman/listinfo/python-list

Re: os._exit vs. sys.exit

2005-07-29 Thread Bryan
"Peter Hansen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Andrew Dalke wrote: >> sys.exit() is identical to "raise SystemExit()". It raises a Python >> exception which may be caught at a higher level in the program stack. > > And which *is* caught at the highest levels of thre

Re: pySerial Windows write problem

2005-07-29 Thread Peter Hansen
Bob Greschke wrote: > "Peter Hansen" <[EMAIL PROTECTED]> wrote in message > >>I'd call it very unusual >>(in my experience) to have a program open and close a serial port >>repeatedly. > > One of the serial ports (there are actually two) is used to read some NMEA > sentences from a GPS. It i

  1   2   >