Re: what is lambda used for in real code?

2004-12-30 Thread Alex Martelli
Steven Bethard <[EMAIL PROTECTED]> wrote: > (2) lambda a: a.lower() > My first thought here was to use str.lower instead of the lambda, but of > course that doesn't work if 'a' is a unicode object: Right, but string.lower works (after an 'import string'). More generally, maybe it would be nice t

Re: OT: novice regular expression question

2004-12-30 Thread M.E.Farmer
It's me wrote: > The shlex.py needs quite a number of .py files. I tried to hunt down a few > of them and got really tire. > > Is there one batch of .py files that I can download from somewhere? > > Thanks, Not sure what you mean by this. Shlex is a standard library module. It imports os and sys

what is lambda used for in real code?

2004-12-30 Thread Steven Bethard
I thought it might be useful to put the recent lambda threads into perspective a bit. I was wondering what lambda gets used for in "real" code, so I grepped my Python Lib directory. Here are some of the ones I looked, classified by how I would rewrite them (if I could): * Rewritable as def st

Re: OT: novice regular expression question

2004-12-30 Thread It's me
The shlex.py needs quite a number of .py files. I tried to hunt down a few of them and got really tire. Is there one batch of .py files that I can download from somewhere? Thanks, "M.E.Farmer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello me, > Have you tried shlex.py it

Re: what would you like to see in a 2nd edition Nutshell?

2004-12-30 Thread Gregor Horvath
RM wrote: What you say is true. However, I didn't think the target audience of this book was newbies. Python newbies yes, but not programming newbies. For programming newbies I would recommend the "Learning Python" book instead. The availability argument, however, is a good point. I was/am a pyt

Urgently need Elecronic version of book:Python Network programming by John Goerz

2004-12-30 Thread mch2k2
Hello All I have just started working on Pyhton. I need urgent help regarding Python Network Programming. I want the elctronic version of the Book: Foundations of Python Network programming by John Goerzen. If anybody among you have that please forward at my mailID. Thank you in advance. Manjeet

Re: Securing a future for anonymous functions in Python

2004-12-30 Thread Paul Rubin
[EMAIL PROTECTED] (Bengt Richter) writes: > print either(A == B, (def "A equals B"), (def "A does not equal B")) > either(thefile, (def thefile.close()), (def 0)) I'd really rather have some reasonable macro facility, than to resort to using anonymous functions and deferred evaluation for common t

Re: Unicode entries on sys.path

2004-12-30 Thread JanC
vincent wehren schreef: > Normally I would have thought this would require using the Microsoft > Layer for Unicode (unicows.dll). If Python is going to use unicows.dll, it might want to use libunicows for compatibility with mingw etc.: -- JanC "Be strict

Re: python versions of perl modules

2004-12-30 Thread Michael Fuhr
[EMAIL PROTECTED] writes: > So is that a yes or a no to the man's question? Some people think that teaching others how to find answers for themselves is a greater service than simply giving them an answer. It helps them become more self-sufficient, which leads to increased productivity becase the

Re: built-in 'property'

2004-12-30 Thread Steven Bethard
Sean Ross wrote: I'll note that it is possible to change the built-in property (in a backward compatible manner) to be used as a decorator for this idiom, to redefine parts of properties in sub-classes, and to provide default get/set/del methods. Is there a recipe or blog or something somewhere tha

Re: Securing a future for anonymous functions in Python

2004-12-30 Thread Steven Bethard
Jeff Shannon wrote: My thesis here is that one of the most common (legitimate) uses of lambda is as an adapter, to create an intermediary that allows a callable with a given signature to be used in places where a different signature is expected -- that is, altering the number or order of argume

Re: Securing a future for anonymous functions in Python

2004-12-30 Thread Bengt Richter
On Thu, 30 Dec 2004 17:39:06 -0800, Jeff Shannon <[EMAIL PROTECTED]> wrote: >Bengt Richter wrote: > >> On Thu, 30 Dec 2004 15:15:51 -0800, Jeff Shannon <[EMAIL PROTECTED]> wrote: >> >>>Mimicking function-def indentation inside of another function's arglist >>>strikes me as an abomination just wa

Re: what would you like to see in a 2nd edition Nutshell?

2004-12-30 Thread Nick Coghlan
JoeG wrote: wxPython takes on more of the native platform's interface. I say seems to because I haven't actually written any code with it. While Tkinter is the GUI toolkit shipped *with* Python, then that's the correct toolkit for Alex to cover in PiaN. Mentioning other toolkits (and providing r

Re: what would you like to see in a 2nd edition Nutshell?

2004-12-30 Thread Nick Coghlan
Mariano Draghi wrote: I think that somehow Python's "J2EE" equivalent is already out there (sort of...), I think it's called PEAK. . . Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --- http://

Re: Pyparsing: Non-greedy matching?

2004-12-30 Thread Peter Fein
On 12/31/04 03:00 AM CST, "Paul McGuire" <[EMAIL PROTECTED]> sayeth: > Assuming that your tag wont contain any nested tag, you > could define your data content as "everything up until I find > ''". For this you can use pyparsing's SkipTo element. I think > if you define data as: > data = Sk

Re: Securing a future for anonymous functions in Python

2004-12-30 Thread Nick Coghlan
Michael Spencer wrote: while we're at it, perhaps 'for' would be more appropriate: (expression for args(a, *args, **kw)) Hmm, what about an 'abbreviated generator expression' syntax: ( for ) For instance: (f(a) + g(b) - h(c) for (a, b, c)) (the 'in' clause of the standard generator expression i

Re: Speed ain't bad

2004-12-30 Thread Jeremy Bowers
On Fri, 31 Dec 2004 01:41:13 +0100, Bulba! wrote: > > One of the posters inspired me to do profiling on my newbie script (pasted > below). After measurements I have found that the speed of Python, at least > in the area where my script works, is surprisingly high. > > This is the experiment: a s

Re: python versions of perl modules

2004-12-30 Thread Marius Bernklev
* [EMAIL PROTECTED] > So is that a yes or a no to the man's question? Of course it is. -- Marius Bernklev Holmgang: Deodoranter har parfyme, mens folk bare kaster kaffegruten. Bør nye PC-er inkludere ekstra USB-kabel? Vi tar debatten! -- http://mail.python.org/mailman/listinfo/python-li

Re: python versions of perl modules

2004-12-30 Thread birdfamily
So is that a yes or a no to the man's question? -- http://mail.python.org/mailman/listinfo/python-list

Re: Securing a future for anonymous functions in Python

2004-12-30 Thread Nick Coghlan
Carl Banks wrote: Nick Coghlan wrote: In much the same way that programmers often spend a lot of time optimizing parts of their program that will yield very minor dividends, while they could have spent that time working on other things that will pay off a lot, many of the wannabe language designers

Re: Pyparsing: Non-greedy matching?

2004-12-30 Thread Paul McGuire
"Peter Fein" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm trying to use pyparsing write a screenscraper. I've got some > arbitrary HTML text I define as opener & closer. In between is the HTML > data I want to extract. However, the data may contain the same > characters as u

Re: Securing a future for anonymous functions in Python

2004-12-30 Thread Nick Coghlan
Bengt Richter wrote: This is an easy trap to fall into, so if the new lambda-substitute could provide a prettier current-closure-variable-value capture than passing a dummy default value or nesting another def and passing the value in, to provide a private closure for each, that might be somethin

Re: Tkinter (OOP?) help

2004-12-30 Thread Mike Meyer
"3c273" <[EMAIL PROTECTED]> writes: > Hello, > I am trying to expand on a tutorial I am working through and I am not > understanding something. In the following example if you click on the "New > window" button, a new window appears with a "Close me" button in it and if > you click on it's "Close

Re: Securing a future for anonymous functions in Python

2004-12-30 Thread Nick Coghlan
Batista, Facundo wrote: [Nick Coghlan] #- I just don't understand why people complain so much about #- the restriction to a #- single expression in lambdas, yet there is nary a peep about #- the same #- restriction for generator expressions and list comprehensions. What *I* don't understand (and it

Re: need some help with threading module...

2004-12-30 Thread M.E.Farmer
Yacine, I didn't run it from Idle . I don't use Idle ! I wrote my own IDE when I first started programming in Python, that is what I used(it does execute scripts from the shell ;) What you are seeing is exactly what I was talking about threads and.. dare I say it... bugs . Be sure to look at t

Re: Securing a future for anonymous functions in Python

2004-12-30 Thread Jeff Shannon
Bengt Richter wrote: On Thu, 30 Dec 2004 15:15:51 -0800, Jeff Shannon <[EMAIL PROTECTED]> wrote: Mimicking function-def indentation inside of another function's arglist strikes me as an abomination just waiting to happen; in comparison, the need to type a name twice seems trivial. Self-restraint

Re: The Industry choice

2004-12-30 Thread Bulba!
On Thu, 30 Dec 2004 12:59:57 -0500, Steve Holden <[EMAIL PROTECTED]> wrote: >> We either need time for folks to accept dynamic, "scripting" >> languages, or a lot of "modern" language programmers need to gang up >> against managers and stuff. :) >[...] >Right, what have the managers ever done for

Re: getattr() woes

2004-12-30 Thread Kamilche
Thomas Rast wrote: I've found out about a fundamental problem of attribute lookup, the hard way... Is there anything that can be done about this? It seems to me that the main problem is you're raising an AttributeError when an attribute is private. AttributeError is only raised when an attribute

Re: Why tuples use parentheses ()'s instead of something else like <>'s?

2004-12-30 Thread Jeff Shannon
Alex Martelli wrote: Carl Banks <[EMAIL PROTECTED]> wrote: Then again, millenia past didn't have Frank Gehry (i.e., the Perl of modern architecture). Uhm -- I count the Guggenheim Museum in Bilbao among the _successes_ of modern architecture... I'll give you the Bilbao Guggenheim, which (at least

Re: The Industry choice

2004-12-30 Thread Bulba!
On 30 Dec 2004 08:58:36 -0800, "Sridhar R" <[EMAIL PROTECTED]> wrote: >>From technical point of view, I could not understand the the reasoning >behind using Java in major companies. Sure that Python, is used in >some, but still Java is considered as a sure-job language. > >After being a python p

Pyparsing: Non-greedy matching?

2004-12-30 Thread Peter Fein
I'm trying to use pyparsing write a screenscraper. I've got some arbitrary HTML text I define as opener & closer. In between is the HTML data I want to extract. However, the data may contain the same characters as used in the closer (but not the exact same text, obviously). I'd like to get the

Speed ain't bad

2004-12-30 Thread Bulba!
One of the posters inspired me to do profiling on my newbie script (pasted below). After measurements I have found that the speed of Python, at least in the area where my script works, is surprisingly high. This is the experiment: a script recreates the folder hierarchy somewhere else and stores

Re: Securing a future for anonymous functions in Python

2004-12-30 Thread Bengt Richter
On Thu, 30 Dec 2004 15:15:51 -0800, Jeff Shannon <[EMAIL PROTECTED]> wrote: >David Bolen wrote: > >>>I think this specific use case -- defining callbacks -- should be >>>addressed, rather than proposing a solution to something that isn't >>>necessary. (...) >>> >>> >> >>I'd be interested in t

Re: The Industry choice

2004-12-30 Thread Aahz
In article <[EMAIL PROTECTED]>, Sridhar R <[EMAIL PROTECTED]> wrote: > >What makes such companies to choose Java over dynamic, productive >languages like Python? Are there any viable, technical reasons for >that? It's a decent cross-platform way of delivering libraries compared to C libraries.

Re: Why tuples use parentheses ()'s instead of something else like <>'s?

2004-12-30 Thread Alex Martelli
Carl Banks <[EMAIL PROTECTED]> wrote: > Alex Martellix wrote: > > I think a tiny minority of today's > > architecture and sculpture can rightfully be compared with the > > masterpieces of millennia past. > > Not that I disagree with your overall point, but I suspect a tiny > minority of the archi

Re: Other notes

2004-12-30 Thread Jp Calderone
On Thu, 30 Dec 2004 15:16:42 -0600, Mike Meyer <[EMAIL PROTECTED]> wrote: >Jp Calderone <[EMAIL PROTECTED]> writes: > > > On Wed, 29 Dec 2004 12:38:02 -0600, Mike Meyer <[EMAIL PROTECTED]> wrote: > >>Jp Calderone <[EMAIL PROTECTED]> writes: > >> > This aside, not even Python 3.0 will be flexible

Re: standard IDE in python 3000 (or beyond)? *semi-newbie*

2004-12-30 Thread Bengt Richter
On Thu, 30 Dec 2004 08:34:47 -0500, Steve Holden <[EMAIL PROTECTED]> wrote: >Brendan Kohler wrote: > >> "mike kreiner" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> >>>Are there any plans for developing a standard IDE for python that's >>>included with the python installation?

Tkinter (OOP?) help

2004-12-30 Thread 3c273
Hello, I am trying to expand on a tutorial I am working through and I am not understanding something. In the following example if you click on the "New window" button, a new window appears with a "Close me" button in it and if you click on it's "Close me" button, it works. But, if you click the ori

Re: Securing a future for anonymous functions in Python

2004-12-30 Thread Jeff Shannon
David Bolen wrote: I think this specific use case -- defining callbacks -- should be addressed, rather than proposing a solution to something that isn't necessary. (...) I'd be interested in this approach too, especially if it made it simpler to handle simple manipulation of callback argument

Re: portable text user interface

2004-12-30 Thread Fuzzyman
Miki Tebeka wrote: > Hello Fuzzyman, > > > > > Are there widely used and recommended Python libraries that will > > > > let me makes a portable text user interface? > > > If you just need a text-like interface you can use Tkinter. > > > See (shameless plug) http://developer.berlios.de/projects/bcd

Re: standard IDE in python 3000 (or beyond)? *semi-newbie*

2004-12-30 Thread mike kreiner
I should add that i mean no insult to the IDLE developers. they've done a good job. it just seems that many people, after trying IDLE and being unimpressed, decide to work on one of the myriad other open-source python IDEs. i think we're all looking at python 3000 as being a huge boost for python (

Re: need some help with threading module...

2004-12-30 Thread chahnaz.ourzikene
"Steve Holden" <[EMAIL PROTECTED]> a écrit dans le message de news: [EMAIL PROTECTED] > Could be the OP is using Cygwin, which won't support threading by > default and will give very confusing results > > just-a-guess-ly y'rs - steve Nice try :), but nope :). Yacine Chaouche -- France. -- h

Re: need some help with threading module...

2004-12-30 Thread chahnaz.ourzikene
"M.E.Farmer" <[EMAIL PROTECTED]> a écrit dans le message de news: [EMAIL PROTECTED] > What did you expect? This is what it did on win 2000/python 2.2.3 > ##> controller waiting... 0 loops > ##> controller waiting... 1 loops > Subject : the counter is now 0 > ##> controller waiting..

Re: need some help with threading module...

2004-12-30 Thread Steve Holden
M.E.Farmer wrote: Steve Holden wrote: [snip] Could be the OP is using Cygwin, which won't support threading by default and will give very confusing results Thanks Steve, Well your guess was better then mine :) I didn't know Cygwin did not support threads by default , I will have to remember that.

Re: Securing a future for anonymous functions in Python

2004-12-30 Thread John Roth
"Ian Bicking" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] John Roth wrote: The syntax I prefer (and I don't know if it's actually been suggested before) is to use braces, that is { and }. In other words, an anonymous function looks like: {p1, p2, p3 | stmt1 stmt2 }

Re: standard IDE in python 3000 (or beyond)? *semi-newbie*

2004-12-30 Thread mike kreiner
Thanks for all of your comments. I didn't intend for this to turn into a "which IDE should I use?" posting, but everyone's comments gave me food for thought all the same, and convinced me to try Eclipse and WingIDE. Please forgive me for this lengthy explanation of my view. Much of my original que

RE: vga output

2004-12-30 Thread Gabriel Cosentino de Barros
Title: RE: vga output > svgalib should do what you want; I don't know if there are python > bindings for it, but they should be pretty easy to make if not. I was hopping for a already binded solution :) But i think i can try to do the bindings for that, can someone point me to some good wr

Re: Event-Driven Woes: making wxPython and Twisted work together

2004-12-30 Thread David Bolen
Daniel Bickett <[EMAIL PROTECTED]> writes: > My initial solution was, naturally, the wxPython support inside of the > twisted framework. However, it has been documented by the author that > the support is unstable at this time, and should not be used in > full-scale applications. Rather than the

Re: Compiled bytecode

2004-12-30 Thread Peter Hansen
Rocco Moretti wrote: Peter Hansen wrote: The main script is generally not compiled, but all imported scripts are generally compiled automatically, the first time they are imported, and never again unless the source changes. Someone please correct me if I'm wrong, but I'm under the impression that

Re: Securing a future for anonymous functions in Python

2004-12-30 Thread Bengt Richter
On Thu, 30 Dec 2004 23:28:46 +1000, Nick Coghlan <[EMAIL PROTECTED]> wrote: >GvR has commented that he want to get rid of the lambda keyword for Python >3.0. >Getting rid of lambda seems like a worthy goal, but I'd prefer to see it >dropped >in favour of a different syntax, rather than complet

Re: python versions of perl modules

2004-12-30 Thread Michael Fuhr
"Earl Eiland" <[EMAIL PROTECTED]> writes: > I need to process some tcpdump files. PERL has Net::Pcap and > NetPacket, but I would rather work in PYTHON. Do PYTHON equivialnts > of these two modules exist? Google is your friend. http://www.google.com/ Search for words like "python", "pcap", "p

Re: copying classes?

2004-12-30 Thread Hans Nowak
Jeff Epler wrote: Here's an example of attempting to deepcopy a class: class X: pass ... import copy X is copy.deepcopy(X) Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.2/copy.py", line 179, in deepcopy raise error, \ copy.Error: un-deep-copyable object o

Re: Problem in threading

2004-12-30 Thread Peter Hansen
Mike Meyer wrote: See http://docs.python.org/lib/module-threading.html > which clearly has the words "New in 2.4" on it. It also says that the threading module is loosely based on the Java model. I may have misinterpreted what the "New in 2.4" applies to, which means that the comment about the Jav

Re: Securing a future for anonymous functions in Python

2004-12-30 Thread Paul L. Du Bois
Jp Calderone wrote: > I'm not saying "boo hoo lambdas are crippled fix them waah". I'm saying > "Lambdas and generator comprehensions are not comparable in this sense and > arguments based on one should not be used to support positions about the > other". This post and Michael Spencer's post wh

Re: built-in 'property'

2004-12-30 Thread Sean Ross
"Steven Bethard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] [snip] > For this reason, I usually suggest declaring properties like[1]: > > py> class E(object): > ... def x(): > ... def get(self): > ... return float(self._x) > ... def set(self, x): > .

python versions of perl modules

2004-12-30 Thread Earl Eiland
I need to process a tcpdump file. PERL has Net::Pcap and NetPacket for this purpose. What does PYTHON have? I haven't found anything. Earl Eiland -- http://mail.python.org/mailman/listinfo/python-list

Re: Securing a future for anonymous functions in Python

2004-12-30 Thread David Bolen
Ian Bicking <[EMAIL PROTECTED]> writes: > The one motivation I can see for function expressions is > callback-oriented programming, like: > >get_web_page(url, > when_retrieved={page | >give_page_to_other_object(munge_page(page))}) This is my primary use case for lambda's nowaday

python versions of perl modules

2004-12-30 Thread Earl Eiland
I need to process some tcpdump files. PERL has Net::Pcap and NetPacket, but I would rather work in PYTHON. Do PYTHON equivialnts of these two modules exist? Earl Eiland -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem in threading

2004-12-30 Thread Mike Meyer
Peter Hansen <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> Python's threading models is pretty primitive. You get the C >> model (which is error-prone), the Java model (in 2.4, and also >> error-prone), or Queues. > Can you please expand on your words above? I have no idea > what you are tal

Re: Features for a Python package manager?

2004-12-30 Thread Mike Meyer
Bulba! <[EMAIL PROTECTED]> writes: > On Sat, 25 Dec 2004 11:37:42 +0100, Georg Brandl <[EMAIL PROTECTED]> > wrote: > >>what features would you expect of a Python package manager, similar to >>CPAN or rubygems? > > IMVHO it would be nice if it had a feature for "upload package/module > I have just

Re: Other notes

2004-12-30 Thread Mike Meyer
"Terry Reedy" <[EMAIL PROTECTED]> writes: > "Mike Meyer" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Steve Holden <[EMAIL PROTECTED]> writes: >>> Well, perhaps you can explain how a change that's made at run time >>> (calling the decorator) can affect the parser's compile tim

Re: Other notes

2004-12-30 Thread Mike Meyer
Steve Holden <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: > >> Steve Holden <[EMAIL PROTECTED]> writes: >> > [...] >>> >>>Well, perhaps you can explain how a change that's made at run time >>>(calling the decorator) can affect the parser's compile time behavior, >>>then. At the moment, IIRC, th

Re: Other notes

2004-12-30 Thread Mike Meyer
Jp Calderone <[EMAIL PROTECTED]> writes: > On Wed, 29 Dec 2004 12:38:02 -0600, Mike Meyer <[EMAIL PROTECTED]> wrote: >>Jp Calderone <[EMAIL PROTECTED]> writes: >> > This aside, not even Python 3.0 will be flexible enough to let you define >> > an infix decorator. The language developers are str

Re: Compiled bytecode

2004-12-30 Thread Rocco Moretti
Peter Hansen wrote: The main script is generally not compiled, but all imported scripts are generally compiled automatically, the first time they are imported, and never again unless the source changes. Someone please correct me if I'm wrong, but I'm under the impression that the main script *is*

ANN: NetEpi (pre-alpha) - tools for epidemiology and public health

2004-12-30 Thread Tim Churches
Pre-alpha versions of several Pythonic tools for epidemiology and public health practice are now available under a slightly modified version of the Mozilla Public License - see http://www.netepi.org for further details. Some screenshots and copies of README files and end-user documentation are

Re: More baby squeaking - iterators in a class

2004-12-30 Thread Scott David Daniels
Bulba! wrote: Hello Mr Everyone, From: http://docs.python.org/tut/node11.html#SECTION001190 "Define a __iter__() method which returns an object with a next() method. If the class defines next(), then __iter__() can just return self:" The thing is, I tried to define __iter__() direct

Re: PyQT installation

2004-12-30 Thread Jarek Zgoda
Nanoscalesoft wrote: does that mean PyQT is not forward What a bad thing is this... Whoa, how did you get it? You can buy commercial licenses and be as current as we are on Linux with GPL versions of Qt+PyQt. Oh, and QScintilla and Eric3! -- Jarek Zgoda http://jpa.berlios.de/ | http://www

Re: Event-Driven Woes: making wxPython and Twisted work together

2004-12-30 Thread matiu
Hi Daniel, I went down that road for a long time. I made a recipe to help people out: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/286201 Don't be intimidated by the size, that's a whole demo app complete with gui. It works quite well. It uses two threads, wx runs in the main thread a

project

2004-12-30 Thread jerry wise
I need some help on a project. I've never used python, and basically what I want to do is have a program where I can bang small wav or mp3 files together end to end. I want to be able to select say 10 files and have the program come up with all the possible combinations of those ten to be saved on

Re: Why tuples use parentheses ()'s instead of something else like <>'s?

2004-12-30 Thread Carl Banks
Alex Martellix wrote: > I think a tiny minority of today's > architecture and sculpture can rightfully be compared with the > masterpieces of millennia past. Not that I disagree with your overall point, but I suspect a tiny minority of the architecture and sculpture from millenia past can be right

Re: Securing a future for anonymous functions in Python

2004-12-30 Thread Carl Banks
Nick Coghlan wrote: > GvR has commented that he want to get rid of the lambda keyword for Python 3.0. > Getting rid of lambda seems like a worthy goal, but I'd prefer to see it dropped > in favour of a different syntax, rather than completely losing the ability to > have anonymous functions. I sha

Re: More baby squeaking - iterators in a class

2004-12-30 Thread Terry Reedy
"Bulba!" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Define a __iter__() method which returns an object with a next() > method. If the class defines next(), then __iter__() can just return > self:" > > The thing is, I tried to define __iter__() directly without explicit > defin

Re: OT: novice regular expression question

2004-12-30 Thread M.E.Farmer
Hello me, Have you tried shlex.py it is a tokenizer for writing lexical parsers. Should be a breeze to whip something up with it. an example of tokenizing: py>import shlex py># fake an open record py>import cStringIO py>myfakeRecord = cStringIO.StringIO() py>myfakeRecord.write("['1','2'] \n 'fdfdfd

Re: Mixing metaclasses and exceptions

2004-12-30 Thread Phillip J. Eby
Jp Calderone wrote: > I'd skip that, though. Your problem doesn't sound "Metaclass!" at me. > I wonder if you could elaborate on your usage? Perhaps there's a better > solution which doesn't involve metaclasses at all. I suspect he could *maybe* get by without the metaclass, but not without cu

Re: what would you like to see in a 2nd edition Nutshell?

2004-12-30 Thread matiu
I enjoyed the first edition. Please include: vpython.org, twisted and pygame and if you'll consider a gui toolkit do pygtk, we use it to develop and deploy on both windows and linux, with glade gui designer and libglade (loads the glade xml files in runtime). It's much easier to use than wx and

Re: OT: novice regular expression question

2004-12-30 Thread It's me
I'll chew on this. Thanks, got to go. "Steve Holden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > It's me wrote: > > > I am never very good with regular expressions. My head always hurts > > whenever I need to use it. > > > Well, they are a pain to more than just you, and the c

Re: what would you like to see in a 2nd edition Nutshell?

2004-12-30 Thread Mariano Draghi
Alex Martelli escribió: Yes, good point... I _do_ plan another book after I'm done with the 2nd ed Nutshell, though ti will mostly be about Design Patterns and development methods so may not meet your exact desires... Now I'm anxious! *that* is the book I'm waiting for :) I think the Python commu

Re: Securing a future for anonymous functions in Python

2004-12-30 Thread Skip Montanaro
John> In other words, an anonymous function looks like: John> {p1, p2, p3 | John> stmt1 John> stmt2 John> } John> There are two reasons for using braces. One is that it's the John> common syntax for blocks in a large number of languages. Yeah, bu

Re: need some help with threading module...

2004-12-30 Thread M.E.Farmer
Steve Holden wrote: [snip] >Could be the OP is using Cygwin, which won't support threading by >default and will give very confusing results Thanks Steve, Well your guess was better then mine :) I didn't know Cygwin did not support threads by default , I will have to remember that. Why do you suppo

Re: Securing a future for anonymous functions in Python

2004-12-30 Thread Roy Smith
Ian Bicking <[EMAIL PROTECTED]> wrote: > I think this specific use case -- defining callbacks -- should be > addressed, rather than proposing a solution to something that isn't > necessary. Which is to say, no one *needs* anonymous functions; people > may need things which anonymous functions p

Re: portable text user interface

2004-12-30 Thread Maxim Kasimov
Grant Edwards wrote: On 2004-12-30, Maxim Kasimov <[EMAIL PROTECTED]> wrote: yes i'm telneting (sshing), that is the reason why i'm looking for libs for making text interfaces. i know there is a project named "anakonda" - red hat linux installer, but it is uses specific C libs. i can use only pyth

PSF donations update

2004-12-30 Thread Stephan Deibel
Hi, Just wanted to follow up on my earlier message requesting donations to the Python Software Foundation. The PSF has now announced the projects we are funding in our first round of grants: http://www.python.org/psf/grants/ We received many other quality grant proposals that could not be funde

Re: what would you like to see in a 2nd edition Nutshell?

2004-12-30 Thread Alex Martelli
On 2004 Dec 30, at 19:19, Dave Reed wrote: This discussion is making me think what would be really nice is an advanced Python book that discusses many of the topics mentioned in this message and earlier messages in the thread. I'd rather see an in-depth advanced book than light coverage of the topi

Re: need some help with threading module...

2004-12-30 Thread Steve Holden
M.E.Farmer wrote: chahnaz.ourzikene wrote: Hi, I fixed the code, it runs under Linux but not under windows 0_o ??! i guess windows and Linux do not handle threads the same way. However, i don't have the result i excpect. What did you expect? This is what it did on win 2000/python 2.2.3 ##> cont

Re: OT: novice regular expression question

2004-12-30 Thread RyanMorillo
check jgsoft dot com, they have2 things witch may help. Edit pad pro (the test version has a good tutorial) or power grep (if you do a lot of regexes, or the mastering regular expressions book from Orielly (if yo do a lot of regex work) Also the perl group would be good for regexes (pythons are P

Re: OT: novice regular expression question

2004-12-30 Thread Steve Holden
It's me wrote: I am never very good with regular expressions. My head always hurts whenever I need to use it. Well, they are a pain to more than just you, and the conventional advice is "even when you are convinced you need to use REs, try and find another way". I need to read a data file and p

Re: Securing a future for anonymous functions in Python

2004-12-30 Thread Ian Bicking
John Roth wrote: The syntax I prefer (and I don't know if it's actually been suggested before) is to use braces, that is { and }. In other words, an anonymous function looks like: {p1, p2, p3 | stmt1 stmt2 } What's the advantage of something like that over the non-anonymous equiva

Re: Why tuples use parentheses ()'s instead of something else like <>'s?

2004-12-30 Thread Reinhold Birkenfeld
Alex Martelli wrote: > Jeff Shannon <[EMAIL PROTECTED]> wrote: >... >> to remember and type some arcane alt-keycode formula to be able to do >> basic scripting would be obnoxious, to say the least. Most keyboards >> worldwide provide decent support for the ASCII character set (though >> some

Event-Driven Woes: making wxPython and Twisted work together

2004-12-30 Thread Daniel Bickett
Hello, I am writing an application using two event-driven libraries: wxPython, and twisted. The first problem I encountered in the program is the confliction between the two all-consuming methods of the two libraries: app.MainLoop, and reactor.run. Additionally, the fact that wxPython was to recei

Re: need some help with threading module...

2004-12-30 Thread M.E.Farmer
chahnaz.ourzikene wrote: > Hi, > > I fixed the code, it runs under Linux but not under windows 0_o ??! i guess > windows and Linux do not handle threads the same way. > > However, i don't have the result i excpect. What did you expect? This is what it did on win 2000/python 2.2.3 ##> controller

Re: The Industry choice

2004-12-30 Thread It's me
"Premshree Pillai" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > It certainly is not because Python is bad or something. Organizations > typically take lot of time to change -- be it technology or office > furniture. > In our industry, the code for the bread and butter tool hasn'

Re: The Industry choice

2004-12-30 Thread Alex Martelli
Sridhar R <[EMAIL PROTECTED]> wrote: ... > What makes such companies to choose Java over dynamic, productive > languages like Python? Are there any viable, technical reasons for > that? Viable AND technical: nah. Viable (forget the technical): yeah. Managers' dreams are about replacing cost

Re: More baby squeaking - iterators in a class

2004-12-30 Thread Alex Martelli
Bulba! <[EMAIL PROTECTED]> wrote: > So which is it? Does next() method HAS to be defined > explicitly? It has to be defined, whether explicitly or not (e.g. via a generator). Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Why tuples use parentheses ()'s instead of something else like <>'s?

2004-12-30 Thread F. Petitjean
On Thu, 30 Dec 2004 15:58:07 GMT, Roel Schroeven wrote: > Rocco Moretti wrote: >> So to summarize: >> >> Commas define tuples, except when they don't, and parentheses are only >> required when they are necessary. >> >> I hope that clears up any confusion. > > You have my vote for QOTW. > +1 :-

Re: what would you like to see in a 2nd edition Nutshell?

2004-12-30 Thread Dave Reed
On Wednesday 29 December 2004 18:01, Alex Martelli wrote: > So -- ctypes is definitely getting a _mention_, at least... the issue > remains of whether we're talking one paragraph, like for all other > extending-tools that were already thus mentioned in the 1st edition, or > a couple of pages (I

Re: More baby squeaking - iterators in a class

2004-12-30 Thread Russell Blau
"Bulba!" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello Mr Everyone, > > From: > http://docs.python.org/tut/node11.html#SECTION001190 > > "Define a __iter__() method which returns an object with a next() > method. If the class defines next(), then __iter__() can

Re: The Industry choice

2004-12-30 Thread Steve Holden
Premshree Pillai wrote: On 30 Dec 2004 08:58:36 -0800, Sridhar R <[EMAIL PROTECTED]> wrote: From technical point of view, I could not understand the the reasoning behind using Java in major companies. Sure that Python, is used in some, but still Java is considered as a sure-job language. It cert

Re: PyQT installation

2004-12-30 Thread Steve Holden
Phil Thompson wrote: On Thursday 30 December 2004 4:13 pm, Steve Holden wrote: Phil Thompson wrote: On Thursday 30 December 2004 2:34 pm, Nanoscalesoft wrote: hi phil... py-->2.4 pyqt-->3.3 I assume you mean PyQt-win-nc-msvc-3.13.exe qt-->2.3.0 I assume you mean the non-commercial edition. The bin

Re: Why would I use inspect.isclass()?

2004-12-30 Thread It's me
"Steve Holden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Well the basic idea is "treat what you've been passed as though it is > the type you wanted". When it's only you writing the code that's likely > going to be the case. When it's others, you have to be a little more > care

Re: Securing a future for anonymous functions in Python

2004-12-30 Thread Michael Spencer
Nick Coghlan wrote: GvR has commented that he want to get rid of the lambda keyword for Python 3.0. Getting rid of lambda seems like a worthy goal, but I'd prefer to see it dropped in favour of a different syntax, rather than completely losing the ability to have anonymous functions. Anyway, I'

  1   2   3   >