Re: Simple - looking for a way to do an element exists check..

2008-02-23 Thread Marc 'BlackJack' Rintsch
On Sat, 23 Feb 2008 17:19:47 -0800, thebjorn wrote: > On Feb 23, 6:18 pm, Paul Hankin <[EMAIL PROTECTED]> wrote: > >> IMO Jason's solution of testing containment in a generator is better >> (more readable). >> if element[0] not in (x[0] for x in a): >> a.append(element) > > It may be

Using lambda [was Re: Article of interest: Python pros/cons for the enterprise]

2008-02-23 Thread Steven D'Aprano
On Sat, 23 Feb 2008 19:35:30 -0800, Jeff Schwab wrote: > Every time somebody uses > lambda here, they seem to get a bunch "why are you using lambda?" > responses. Not from me. I even use "named anonymous functions" *cough* by assigning lambda functions to names: foo = lambda x: x+1 -- Stev

Re: asynchronous alarm

2008-02-23 Thread Paul Rubin
Alan Isaac <[EMAIL PROTECTED]> writes: > while True: > sys.stdout.write('\a') > sys.stdout.flush() > time.sleep(0.5) > > I want to add code to allow me to turn off this alarm and then > interact with the program in its new state (which the al

asynchronous alarm

2008-02-23 Thread Alan Isaac
Goal: turn off an audible alarm without terminating the program. For example, suppose a console program is running:: while True: sys.stdout.write('\a') sys.stdout.flush() time.sleep(0.5) I want to add code to allow me to turn off this alarm

Re: Official IRC channel for Python?

2008-02-23 Thread Paul Rubin
Paul Rudin <[EMAIL PROTECTED]> writes: > You can't join #python on freenode without identifying with nickserv > first. Oh, interesting and annoying. I don't know if I've noticed that before. -- http://mail.python.org/mailman/listinfo/python-list

Re: Official IRC channel for Python?

2008-02-23 Thread Paul Rudin
Paul Rubin writes: > "Manu Hack" <[EMAIL PROTECTED]> writes: >> > Really? maybe I'm been blocked from it... >> > thanks. >> >> Maybe you need your nick name to be recognized. You need to register >> your nickname somewhere. > > On freenode, you need to register your n

Re: Official IRC channel for Python?

2008-02-23 Thread Manu Hack
On 23 Feb 2008 22:21:59 -0800, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > "Manu Hack" <[EMAIL PROTECTED]> writes: > > > Really? maybe I'm been blocked from it... > > > thanks. > > > > > Maybe you need your nick name to be recognized. You need to register > > your nickname somewhere.

Re: Seeing "locals()" from imported function

2008-02-23 Thread 7stud
On Feb 23, 11:41 pm, 7stud <[EMAIL PROTECTED]> wrote: > On Feb 23, 10:06 pm, "Luis M. González" <[EMAIL PROTECTED]> wrote: > > > > > I apologize for this very basic question, but I can't understand how > > this works... > > I want to import a function from module B into my main script A, so > > thi

Re: Seeing "locals()" from imported function

2008-02-23 Thread 7stud
On Feb 23, 10:06 pm, "Luis M. González" <[EMAIL PROTECTED]> wrote: > I apologize for this very basic question, but I can't understand how > this works... > I want to import a function from module B into my main script A, so > this function can see and use the locals from A. > > For example: > > de

Re: Official IRC channel for Python?

2008-02-23 Thread Paul Rubin
"Manu Hack" <[EMAIL PROTECTED]> writes: > > Really? maybe I'm been blocked from it... > > thanks. > > Maybe you need your nick name to be recognized. You need to register > your nickname somewhere. On freenode, you need to register your nick in order to send private messages, but you can join a

Re: Official IRC channel for Python?

2008-02-23 Thread Manu Hack
On Sun, Feb 24, 2008 at 12:16 AM, js <[EMAIL PROTECTED]> wrote: > Really? maybe I'm been blocked from it... > thanks. Maybe you need your nick name to be recognized. You need to register your nickname somewhere. Manu -- http://mail.python.org/mailman/listinfo/python-list

Re: Official IRC channel for Python?

2008-02-23 Thread js
No. Actually, i'm very new to IRC. On Sun, Feb 24, 2008 at 2:55 PM, Steve Holden <[EMAIL PROTECTED]> wrote: > js wrote: > > Really? maybe I'm been blocked from it... > > thanks. > > > Currently 479 users. Have you been blocked from many channels? > > regards > Steve > -- > Steve Holden

Re: PHP Developer highly interested in Python (web development) with some open questions...

2008-02-23 Thread Steve Holden
Tamer Higazi wrote: > Hi! > My brother is dreaming and dying for python and swear that it is the > ultimate killer application language. > > I am coding Webapplication in PHP5 and ask myself if for python are: > > - application frameworks like: "Zend Framework" and ezComponents > - What is the Zo

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Paul Rubin
Jeff Schwab <[EMAIL PROTECTED]> writes: > > languages should be a red flag in a design review, and a factor in > > determining product liability if a program misbehaves. > > Your product gets the benefit of the doubt if it was written in > Python, but not if written in C? What if the Python inter

Re: Official IRC channel for Python?

2008-02-23 Thread Steve Holden
js wrote: > Really? maybe I'm been blocked from it... > thanks. > Currently 479 users. Have you been blocked from many channels? regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/list

PHP Developer highly interested in Python (web development) with some open questions...

2008-02-23 Thread Tamer Higazi
Hi! My brother is dreaming and dying for python and swear that it is the ultimate killer application language. I am coding Webapplication in PHP5 and ask myself if for python are: - application frameworks like: "Zend Framework" and ezComponents - What is the Zope Applikation Server? Is it also a

Re: Official IRC channel for Python?

2008-02-23 Thread js
Really? maybe I'm been blocked from it... thanks. On 23 Feb 2008 20:37:42 -0800, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > js <[EMAIL PROTECTED]> writes: > > I tried #python irc.freenode.net > > That has always worked for me. > > -- > http://mail.python.org/mailman/listinfo/python-l

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Jeff Schwab
Paul Rubin wrote: > Jeff Schwab <[EMAIL PROTECTED]> writes: >>> there's actually a published book specifically about C++ pitfalls. >> Mercy, a whole book? > > http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?EAN=9780201179286 > >>> C and C++ should practically be outlawed at this point

Seeing "locals()" from imported function

2008-02-23 Thread Luis M. González
I apologize for this very basic question, but I can't understand how this works... I want to import a function from module B into my main script A, so this function can see and use the locals from A. For example: def auto(): urls = ['/', 'index'] for k,v in __main__.locals().items():

PHP Developer highly interested in Python (web development) with some open questions...

2008-02-23 Thread Tamer Higazi
Hi! My brother is dreaming and dying for python and swear that it is the ultimate killer application language. I am coding Webapplication in PHP5 and ask myself if for python are: - application frameworks like: "Zend Framework" and ezComponents - What is the Zope Applikation Server? Is it also a

Re: Official IRC channel for Python?

2008-02-23 Thread Paul Rubin
js <[EMAIL PROTECTED]> writes: > I tried #python irc.freenode.net That has always worked for me. -- http://mail.python.org/mailman/listinfo/python-list

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Paul Rubin
Jeff Schwab <[EMAIL PROTECTED]> writes: > > there's actually a published book specifically about C++ pitfalls. > > Mercy, a whole book? http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?EAN=9780201179286 > > C and C++ should practically be outlawed at this point. > > On what grounds?

Official IRC channel for Python?

2008-02-23 Thread js
Howdy, I was wondering if there's official IRC channel for Python. I tried #python irc.freenode.net and irc.openproject.net with no luck. Could you please give me some suggestions? -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a open souce IDE writen by C( C++) or partly writen by C( C++)?

2008-02-23 Thread zaley
On Feb 24, 6:48 am, Ricardo Aráoz <[EMAIL PROTECTED]> wrote: > Lie wrote: > > On Feb 23, 4:02 pm, zaley <[EMAIL PROTECTED]> wrote: > >> On Feb 22, 11:06 pm, "Jesper" wrote: > > >>> Give PyScripter fromhttp://www.mmm-experts.com/atry > >>> It is for Windows, though it is written in Delphi and not i

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Paul Rubin
Jeff Schwab <[EMAIL PROTECTED]> writes: > def mkadder(n): > return lambda x: x + n > > I have gotten the impression that this was somehow inferior in Python > though, at least in terms of performance. Every time somebody uses > lambda here, they seem to get a bunch "why are you usin

python-list@python.org

2008-02-23 Thread castironpi
On Feb 23, 7:47 pm, [EMAIL PROTECTED] wrote: > On Feb 23, 6:19 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: > > > > > > > On Feb 23, 2:03 pm, [EMAIL PROTECTED] wrote: > > > > 1) [EMAIL PROTECTED] > > > > @synchronized > > > def function( arg ): > > >    behavior() > > > > Synchronized prevents usage

Re: Tkinter: Missing the last piece of the puzzle

2008-02-23 Thread Simon Forman
On Feb 23, 9:00 am, [EMAIL PROTECTED] wrote: > I have a simple editor built into my visual parser. It has a File menu > with > typical New, Open, Save, Save As ... options. I now know how to set > the options [en/dis]abled and how to check the Text widget's modified > flag. > > Now I want to [en/di

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Jeff Schwab
Paul Rubin wrote: > Jeff Schwab <[EMAIL PROTECTED]> writes: >> One great thing about C is that >> a programmer can realistically hope to know the entire language >> definition; maybe Guido would like the same to be true of Python. > > C is horrendously complicated, with zillions of obscure traps.

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Jeff Schwab
Paul Rubin wrote: > Jeff Schwab <[EMAIL PROTECTED]> writes: >> So to use the Perl example: If you want to sort a list using some >> arbitrary snippet of code as the comparison function, you can write: >> sort { code to compare $a and $b } @elements > > Yes, you can do that in Python, using a

RE: Hyphenation module PyHyphen-0.3 released

2008-02-23 Thread Ryan Ginstrom
> On Behalf Of Max Erickson > the easy way to do this might be to find(in your mingw /lib > directory) and copy or rename libmsvcr71.a and libmsvcr71d.a > into libmsvcrt.a and libmsvcrtd.a (backing up the originals > if desired). If the MingW you have installed doesn't provide > the appropriate

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Jeff Schwab
Matthew Woodcraft wrote: > Jeff Schwab <[EMAIL PROTECTED]> wrote: >> Matthew Woodcraft wrote: >>> Jeff Schwab <[EMAIL PROTECTED]> wrote: The most traditional, easiest way to open a file in C++ is to use an fstream object, so the file is guaranteed to be closed when the fstream go

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Paul Rubin
Jeff Schwab <[EMAIL PROTECTED]> writes: > So to use the Perl example: If you want to sort a list using some > arbitrary snippet of code as the comparison function, you can write: > sort { code to compare $a and $b } @elements Yes, you can do that in Python, using a lambda expression, a named

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Paul Rubin
Jeff Schwab <[EMAIL PROTECTED]> writes: > One great thing about C is that > a programmer can realistically hope to know the entire language > definition; maybe Guido would like the same to be true of Python. C is horrendously complicated, with zillions of obscure traps. C++ is even worse; there's

Re: Hyphenation module PyHyphen-0.3 released

2008-02-23 Thread Max Erickson
thebjorn <[EMAIL PROTECTED]> wrote: > Visual Studio 2003 was not found on this system. If you have > Cygwin > installed, > you can try compiling with MingW32, by passing "-c mingw32" to > setup.py. > -- bjorn You need to convince MingW to use the correct VS runtime. Cribbing from: http://

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Jeff Schwab
Paul Rubin wrote: > "Terry Reedy" <[EMAIL PROTECTED]> writes: >> | Yes, this seems to be the Python way: For each popular feature of some >> | other language, create a less flexible Python feature that achieves the >> | same effect in the most common cases (e.g. lambda to imitate function >> | lit

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Jeff Schwab
Terry Reedy wrote: > "Jeff Schwab" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > [snip discussion of 'with' statements] > > | Yes, this seems to be the Python way: For each popular feature of some > | other language, create a less flexible Python feature that achieves the > | s

Re: Simple - looking for a way to do an element exists check..

2008-02-23 Thread thebjorn
On Feb 24, 2:24 am, Paul Rubin wrote: > thebjorn <[EMAIL PROTECTED]> writes: > > If the lists are long enough to care, either rewrite use a set-based > > solution if the items are hashable, or keep the elements sorted and > > rewrite to use the bisect module if the elemen

python-list@python.org

2008-02-23 Thread castironpi
On Feb 23, 6:19 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Feb 23, 2:03 pm, [EMAIL PROTECTED] wrote: > > > > > > > > > 1) [EMAIL PROTECTED] > > > @synchronized > > def function( arg ): > >    behavior() > > > Synchronized prevents usage from more than one caller at once: look up > > the funct

Re: can't set attributes of built-in/extension type

2008-02-23 Thread Steve Holden
Steve Holden wrote: > Neal Becker wrote: >> Steve Holden wrote: >> >>> Neal Becker wrote: Steve Holden wrote: > Neal Becker wrote: >> 7stud wrote: >> >>> On Feb 21, 11:19 am, Neal Becker <[EMAIL PROTECTED]> wrote: I'm working on a simple extension. Following the

Re: Simple - looking for a way to do an element exists check..

2008-02-23 Thread Paul Rubin
thebjorn <[EMAIL PROTECTED]> writes: > If the lists are long enough to care, either rewrite use a set-based > solution if the items are hashable, or keep the elements sorted and > rewrite to use the bisect module if the elements can be ordered. Well, you want a tree data structure to have fast ins

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Hrvoje Niksic
"Terry Reedy" <[EMAIL PROTECTED]> writes: > "Jeff Schwab" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > [snip discussion of 'with' statements] > > | Yes, this seems to be the Python way: For each popular feature of some > | other language, create a less flexible Python feature

Re: Simple - looking for a way to do an element exists check..

2008-02-23 Thread thebjorn
On Feb 23, 6:18 pm, Paul Hankin <[EMAIL PROTECTED]> wrote: > On Feb 22, 7:01 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: > > > On Feb 22, 12:54 pm, Paul Rubin wrote: > > > > Paul Rubin writes: > > > > if any(x==element[0] for x in a): > > >

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Paul Rubin
"Terry Reedy" <[EMAIL PROTECTED]> writes: > | Yes, this seems to be the Python way: For each popular feature of some > | other language, create a less flexible Python feature that achieves the > | same effect in the most common cases (e.g. lambda to imitate function > | literals, or recursive assi

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Terry Reedy
"Jeff Schwab" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] [snip discussion of 'with' statements] | Yes, this seems to be the Python way: For each popular feature of some | other language, create a less flexible Python feature that achieves the | same effect in the most common ca

Re: Hyphenation module PyHyphen-0.3 released

2008-02-23 Thread thebjorn
On Feb 23, 8:35 pm, "Dr. leo" <[EMAIL PROTECTED]> wrote: > I am pleased to share with you the great features of the latest version. > Large parts of the sources were completely rewritten. Also, they are now > reasonably documented. > > Just go tohttp://pypi.python.org/pypi/PyHyphen/0.3 > > I was te

Re: bus error/segfault from PyArg_ParseTuple in initproc with incorrect arg number

2008-02-23 Thread Andrew MacIntyre
Miles Lubin wrote: > I am using PyArg_ParseTuple to parse the arguments (ignoring the keyword > arguments) to my initproc for a type I define. > It seems that something goes wrong inside PyArg_ParseTuple when it gets > the wrong number of arguments (my format string is "OO"); > if the function is

Re: Return value of an assignment statement?

2008-02-23 Thread Terry Reedy
"Tim Roberts" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: | | >On Fri, 22 Feb 2008 11:00:17 -0800, Aahz wrote: | > | >> It's just too convenient to be able to write | >> | >> L += ['foo'] | >> | >> without rebinding L. | > | >B

python-list@python.org

2008-02-23 Thread Paul McGuire
On Feb 23, 2:03 pm, [EMAIL PROTECTED] wrote: > > 1) [EMAIL PROTECTED] > > @synchronized > def function( arg ): >    behavior() > > Synchronized prevents usage from more than one caller at once: look up > the function in a hash, acquire its lock, and call. > > def synchronized( func ): >    def pres

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Paul Rubin
Nicola Musatti <[EMAIL PROTECTED]> writes: > >>>a = [f(x) + g(y) for x,y in izip(m1, m2) if h(x,y).frob() == 7] > [...] > > There you replace one line of code with 40+ lines to get around the > > absence of GC. Sounds bug-prone among other things. > > Come on, you didn't define f, g, izip, h

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Paul Rubin
Jeff Schwab <[EMAIL PROTECTED]> writes: > some_class().method() > The method body could create an external reference to the instance of > some_class, such that the instance would not be reclaimed at the end of > the statement. Yes. Therefore there is no way to predict if the object will be

looking for open source simulink clone in python

2008-02-23 Thread [EMAIL PROTECTED]
Does anyone know of something like this? I've searched to no avail. GNUradio companion is promising but tied to gnuradio. -- http://mail.python.org/mailman/listinfo/python-list

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Matthew Woodcraft
Jeff Schwab <[EMAIL PROTECTED]> wrote: >Matthew Woodcraft wrote: >> Jeff Schwab <[EMAIL PROTECTED]> wrote: >>> The most traditional, easiest way to open a file in C++ is to use an >>> fstream object, so the file is guaranteed to be closed when the fstream >>> goes out of scope. >> Out of inte

Re: Python camping in Argentina

2008-02-23 Thread Terry Reedy
"Facundo Batista" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Looks like a great event. |And of course, we lunched and dinner all together, played games, What is the hexagon board game? And, is the one woman I saw in the group photo a programmer? (I am trying to entice my daug

Python camping in Argentina

2008-02-23 Thread Facundo Batista
Hi! This post is to tell you about a Python event we had the last weekend. It was a Python camping, in Los Cocos, Córdoba, Argentina. More than 20 Python developers, some experienced, some new ones, joined together in a center where we made a lot of activities during four whole days: - We had a

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Jeff Schwab
Matthew Woodcraft wrote: > Jeff Schwab <[EMAIL PROTECTED]> wrote: >> The most traditional, easiest way to open a file in C++ is to use an >> fstream object, so the file is guaranteed to be closed when the fstream >> goes out of scope. > > Out of interest, what is the usual way to manage errors

Re: Return value of an assignment statement?

2008-02-23 Thread Tim Roberts
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >On Fri, 22 Feb 2008 11:00:17 -0800, Aahz wrote: > >> It's just too convenient to be able to write >> >> L += ['foo'] >> >> without rebinding L. > >But ``+=`` does rebind. Usually, but there's an exception for lists, which a specific implement

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Matthew Woodcraft
Jeff Schwab <[EMAIL PROTECTED]> wrote: > The most traditional, easiest way to open a file in C++ is to use an > fstream object, so the file is guaranteed to be closed when the fstream > goes out of scope. Out of interest, what is the usual way to manage errors that the operating system reports

Re: ILeo (IPython-Leo bridge); a marriage made in heaven?

2008-02-23 Thread Ville Vainio
On Feb 23, 10:54 pm, Ricardo Aráoz <[EMAIL PROTECTED]> wrote: > Are you part of Leo? This smells like a marketing scheme to me. Yes, Edward is part of Leo and I am part of IPython. In fact, most of my income comes from selling IPython T-shirts at the local flea market and I therefore have to reso

Re: Is there a open souce IDE writen by C( C++) or partly writen by C( C++)?

2008-02-23 Thread Ricardo Aráoz
Lie wrote: > On Feb 23, 4:02 pm, zaley <[EMAIL PROTECTED]> wrote: >> On Feb 22, 11:06 pm, "Jesper" wrote: >> >> >> >>> Give PyScripter fromhttp://www.mmm-experts.com/atry >>> It is for Windows, though it is written in Delphi and not in C/C++ >>> /Jesper >>> "zaley" <[EMAIL PROTECTED]> skrev i en m

Re: Globals or objects?

2008-02-23 Thread Steven D'Aprano
On Sat, 23 Feb 2008 08:16:44 -0500, Steve Holden wrote: > Steven D'Aprano wrote: >> On Fri, 22 Feb 2008 18:53:54 +, tinnews wrote: >> > But you're not comparing what the OP posted. He was comparing a > global with an object with a single variable inside it. Either > would work w

python-list@python.org

2008-02-23 Thread castironpi
Corrections. Typographical error in the implementation of #1. def synchronized( func ): def presynch( *ar, **kwar ): with _synchlock: lock= _synchhash.setdefault( func, allocate_lock() ) with lock: return func( *ar, **kwar ) return presynch On footnote #4, one

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Rhamphoryncus
On Feb 23, 11:39 am, Nicola Musatti <[EMAIL PROTECTED]> wrote: > Paul Rubin wrote: > > Nicola Musatti <[EMAIL PROTECTED]> writes: > >>>a = [f(x) + g(y) for x,y in izip(m1, m2) if h(x,y).frob() == 7] > [...] > > There you replace one line of code with 40+ lines to get around the > > absence of G

Re: Is there a open souce IDE writen by C( C++) or partly writen by C( C++)?

2008-02-23 Thread Lie
On Feb 23, 4:02 pm, zaley <[EMAIL PROTECTED]> wrote: > On Feb 22, 11:06 pm, "Jesper" wrote: > > > > > Give PyScripter fromhttp://www.mmm-experts.com/atry > > > It is for Windows, though it is written in Delphi and not in C/C++ > > > /Jesper > > > "zaley" <[EMAIL PROTECTED]> skrev i en meddelelsene

Re: graphing/plotting with python and interface builder

2008-02-23 Thread Jacob Davis
I found SM2DGraphView, but I guess that I am too much of a newbie with interface builder and pyobjc to figure out how to get SM2DGraphView to work. Are there any good tutorials (or better yet, examples) of how to get SM2DGraphView to work? I don't know pyobjc well at all. Thanks Jake On

Re: Replacing 'if __name__ == __main__' with decorator (was: Double underscores -- ugly?)

2008-02-23 Thread castironpi
> @mainmethod > def main(...) > > and like this: > > @mainmethod(parser=myparser) > def main(...) > > then you cannot use that decorator for a function that expects or > allows a function as its first argument? Because how and If it's called with only one non-keyword parameter, then the language m

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Jeff Schwab
Carl Banks wrote: > On Feb 23, 6:40 am, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> Recently, I've had a few replies in tones that imply I'm on the brink of >> entering several kill-files, mostly because I express disagreement with >> a few closely held beliefs of some other c.l.p posters. > > A bit

python-list@python.org

2008-02-23 Thread castironpi
To whoso has a serious interest in multi-threading: What advanced thread techniques does Python support? 1) @synchronized @synchronized def function( arg ): behavior() Synchronized prevents usage from more than one caller at once: look up the function in a hash, acquire its lock, and call.

Re: ILeo (IPython-Leo bridge); a marriage made in heaven?

2008-02-23 Thread Ricardo Aráoz
Edward K Ream wrote: >> Here is something cool that will rock your world (ok, excuse the slight >> hyperbole): > > Many thanks for this posting, Ville. It is indeed very cool: > > - It shows how Leo can be used *now* as an IPython notebook. > > - It expands the notion of what is possible with

Hyphenation module PyHyphen-0.3 released

2008-02-23 Thread Dr. leo
I am pleased to share with you the great features of the latest version. Large parts of the sources were completely rewritten. Also, they are now reasonably documented. Just go to http://pypi.python.org/pypi/PyHyphen/0.3 I was tempted to classify it as Beta. Indeed I am not aware of any bugs, but

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Nicola Musatti
Paul Rubin wrote: > Nicola Musatti <[EMAIL PROTECTED]> writes: >>>a = [f(x) + g(y) for x,y in izip(m1, m2) if h(x,y).frob() == 7] [...] > There you replace one line of code with 40+ lines to get around the > absence of GC. Sounds bug-prone among other things. Come on, you didn't define f, g,

Re: graphing/plotting with python and interface builder

2008-02-23 Thread Jacob Davis
Thanks for the reply. I have wxPython installed and have used it. with wx I have just been using the wx.lib.plot module and the graphing is fine (although in other posts I note some focus issues). I have been looking at moving to using interface builder 3.0 and building Cocoa apps because

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Nicola Musatti
Marc 'BlackJack' Rintsch wrote: [...] > Or are used to think of OOP as a graph of objects that are communicating > with each other. In the value type style you are "talking" to copies of > objects all the time which I find a bit confusing because *I* have to keep > track of which maybe not so iden

Re: The big shots

2008-02-23 Thread Ricardo Aráoz
Dotan Cohen wrote: > On 20/02/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> It's a bad sign. If you aren't keeping your thoughts to yourself, and >> thrashing about the world for a peer, a social network, a support >> group, or a community, then you missed the day in grammar school when

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Carl Banks
On Feb 23, 6:40 am, Jeff Schwab <[EMAIL PROTECTED]> wrote: > Recently, I've had a few replies in tones that imply I'm on the brink of > entering several kill-files, mostly because I express disagreement with > a few closely held beliefs of some other c.l.p posters. A bit of advice: Python and C++

Re: Return value of an assignment statement?

2008-02-23 Thread John Henry
On Feb 23, 2:59 am, Jeff Schwab <[EMAIL PROTECTED]> wrote: > Dennis Lee Bieber wrote: > > On Fri, 22 Feb 2008 11:23:27 -0800, Jeff Schwab <[EMAIL PROTECTED]> > > declaimed the following in comp.lang.python: > > >> I'm about through with this discussion, but FWIW, this is a real gotcha > >> for me a

Web tutorial temporarily moved

2008-02-23 Thread learn2program
My programming tutorial web site has been dead this past week. This is just to say that I have copied the English version to a temporary mirror: http://uk.geocities.com/[EMAIL PROTECTED]/ Normal service will hopefully be resumed soon. Just in case anyone was wondering where it had gone! :-) Ala

Re: Handling locked db tables...

2008-02-23 Thread M.-A. Lemburg
On 2008-02-20 17:19, breal wrote: > On Feb 20, 8:05 am, "M.-A. Lemburg" <[EMAIL PROTECTED]> wrote: >> On 2008-02-20 16:24, breal wrote: >> >>> I have a db table that holds a list of ports. There is a column >>> in_use that is used as a flag for whether the port is currently in >>> use. When choos

Re: Return value of an assignment statement?

2008-02-23 Thread Jeff Schwab
Arnaud Delobelle wrote: > On Feb 23, 3:44 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> actions = ( >> ('some_string', do_something), >> ('other_string', do_other_thing)) >> >> def find_action(pattern): >> for string, action in actions: >> m

Re: Simple - looking for a way to do an element exists check..

2008-02-23 Thread Paul Hankin
On Feb 22, 7:01 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Feb 22, 12:54 pm, Paul Rubin wrote: > > > Paul Rubin writes: > > >     if any(x==element[0] for x in a): > > >       a.append(element) > > > Should say: > > >      if any(x[0]==ele

Re: Return value of an assignment statement?

2008-02-23 Thread Arnaud Delobelle
On Feb 23, 3:44 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: > >      actions = ( >              ('some_string', do_something), >              ('other_string', do_other_thing)) > >      def find_action(pattern): >          for string, action in actions: >              m = pattern.match(string) >    

Tkinter: Missing the last piece of the puzzle

2008-02-23 Thread MartinRinehart
I have a simple editor built into my visual parser. It has a File menu with typical New, Open, Save, Save As ... options. I now know how to set the options [en/dis]abled and how to check the Text widget's modified flag. Now I want to [en/dis]able those options. Can I ask the text to notify me when

Re: Return value of an assignment statement?

2008-02-23 Thread Paddy
On 21 Feb, 23:33, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > What you can't do (that I really miss) is have a tree of assign-and-test > > expressions: > > > import re > > pat = re.compile('some pattern') > > > if m = pat.match(some_string): > > do_somethi

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Jeff Schwab
Paul Rubin wrote: > Jeff Schwab <[EMAIL PROTECTED]> writes: >> The most traditional, easiest way to open a file in C++ is to use an >> fstream object, so the file is guaranteed to be closed when the >> fstream goes out of scope. > > Python has this too, except it's using a special type of scope

Re: Simple - looking for a way to do an element exists check..

2008-02-23 Thread Boris Ozegovic
TeroV wrote: > It isn't list comprehension, it is generator expression > http://en.wikipedia.org/wiki/Python_syntax_and_semantics#Generator_expressions Nice. :) -- http://mail.python.org/mailman/listinfo/python-list

integrating python with owl

2008-02-23 Thread Noorhan Abbas
Hello, I have developed an ontology using protege owl and I wonder if you can help me get any documentation on how to integrate it with python. Thank you very much, Noorhan. __ Sent from Yahoo! Mail. A Smarter Inbox. http://uk.docs.

Re: Return value of an assignment statement?

2008-02-23 Thread Jeff Schwab
Jeff Schwab wrote: > mrstephengross wrote: >> Hi all. In C, an assignment statement returns the value assigned. For >> instance: >> >> int x >> int y = (x = 3) >> >> In the above example, (x=3) returns 3, which is assigned to y. >> >> In python, as far as I can tell, assignment statements don't

Re: Return value of an assignment statement?

2008-02-23 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: >> What you can't do (that I really miss) is have a tree of assign-and-test >> expressions: >> >> import re >> pat = re.compile('some pattern') >> >> if m = pat.match(some_string): >> do_something(m) >> else if m = pat.match(other

Prophet Muhammad the last Messenger in the Bible

2008-02-23 Thread dawa-dawa
Prophet Muhammad the last Messenger in the Bible http://www.islamhouse.com/p/51913 -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple - looking for a way to do an element exists check..

2008-02-23 Thread TeroV
Boris Ozegovic wrote: > Paul Rubin wrote: > >> if any(x[0]==element[0] for x in a): > > How come this list comprehension isn't in [] brackets? It isn't list comprehension, it is generator expression http://en.wikipedia.org/wiki/Python_syntax_and_semantics#Generator_expressions -- Tero --

Re: Odd behaviour of *.pth files and Apache

2008-02-23 Thread D'Arcy J.M. Cain
On Thu, 21 Feb 2008 13:55:25 -0500 "D'Arcy J.M. Cain" <[EMAIL PROTECTED]> wrote: > I tried searching the archives for information on this but nothing > seemed to be germane. I am running Python sripts as CGI under Apache > and I have a .pth file in site-packages that includes directory that > has

Re: Getting stdout from other processes

2008-02-23 Thread Matthias Vogelgesang
Hi, Miki wrote: > The current "official" module to use is subprocess (pipe = > Popen([client], stdout=PIPE)) > However if the client is sending data, reading from the pipe.stdout > will block the server. > If you *need* to wait, then you can use pipe.wait(), otherwise do as > Diez suggested and ha

Re: Simple - looking for a way to do an element exists check..

2008-02-23 Thread Boris Ozegovic
Paul Rubin wrote: > if any(x[0]==element[0] for x in a): How come this list comprehension isn't in [] brackets? -- http://mail.python.org/mailman/listinfo/python-list

Re: ILeo (IPython-Leo bridge); a marriage made in heaven?

2008-02-23 Thread Edward K Ream
> Here is something cool that will rock your world (ok, excuse the slight > hyperbole): Many thanks for this posting, Ville. It is indeed very cool: - It shows how Leo can be used *now* as an IPython notebook. - It expands the notion of what is possible with Leo/IPython/Python scripts. Your i

Re: graphing/plotting with python and interface builder

2008-02-23 Thread Diez B. Roggisch
Jacob Davis schrieb: > Hi. > > I am developing for mac and using Xcode and Interface Builder 3.0. I > can make a simple application, but I am having a hard time trying to > figure out a good way to create a graph or plot for a class project. > > Does anybody have any tips on where to get start

Re: can't set attributes of built-in/extension type

2008-02-23 Thread Steve Holden
Neal Becker wrote: > Steve Holden wrote: > >> Neal Becker wrote: >>> Steve Holden wrote: >>> Neal Becker wrote: > 7stud wrote: > >> On Feb 21, 11:19 am, Neal Becker <[EMAIL PROTECTED]> wrote: >>> I'm working on a simple extension. Following the classic 'noddy' >>> example

Re: Return value of an assignment statement?

2008-02-23 Thread Steve Holden
Paul Rubin wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >> Personally, I think the confusion of augmented assignments is not worth >> the benefit of saving typing a couple of characters. I think Guido's >> first decision, to leave += etc out of the language, was the right >> decision. >

Re: n00b with urllib2: How to make it handle cookie automatically?

2008-02-23 Thread Steve Holden
7stud wrote: > On Feb 21, 11:50 pm, est <[EMAIL PROTECTED]> wrote: >> class SmartRequest(): >> > > You should always define a class like this: > > class SmartRequest(object): > > > unless you know of a specific reason not to. > > It's much easier, though, just to put __metaclass__ = type at

Re: Globals or objects?

2008-02-23 Thread Steve Holden
Steven D'Aprano wrote: > On Fri, 22 Feb 2008 18:53:54 +, tinnews wrote: > But you're not comparing what the OP posted. He was comparing a global with an object with a single variable inside it. Either would work with the y = spam(arg) example above. >>> What do you mean by "an

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Jeff Schwab
Ryan Ginstrom wrote: >> On Behalf Of Jeff Schwab >> When I see this silliness again and again, it really breaks >> my heart > > If you allow your heart to be broken by others' opinions, you're setting > yourself up for a lot of disappointment IMHO. It's not so much their opinions, as the fact th

RE: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Ryan Ginstrom
> On Behalf Of Jeff Schwab > When I see this silliness again and again, it really breaks > my heart If you allow your heart to be broken by others' opinions, you're setting yourself up for a lot of disappointment IMHO. I personally used C++ for about 90% of my code for 10 years. During that time

  1   2   >