Re: module confusion

2007-10-01 Thread Marc 'BlackJack' Rintsch
On Tue, 02 Oct 2007 19:34:29 +1300, Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Robert > Kern wrote: > >> Not all of the modules in a package are imported by importing the >> top-level package. > > You can't import packages, only modules. Oh come on, this is unnecessary nitpick

RE: Wrapper functions and arguments

2007-10-01 Thread Ryan Ginstrom
> On Behalf Of Jeremy Sanders > def a(x, y, z): > print x, y, z > def b(x, y, z='fruitbat') > print x, y, z > > for func in a, b: > def wrapper(func=func, *args, **argsk): > # do something > func(*args, **argsk) > x.append(wrapper) > > x[0](1, 2, 3) > x[1](1, 2) > ... > > Is th

Re: module confusion

2007-10-01 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Robert Kern wrote: > Not all of the modules in a package are imported by importing the > top-level package. You can't import packages, only modules. > os.path is a particularly weird case because it is just an alias to the > platform-specific path-handling module;

Re: slice last 4 items from a list

2007-10-01 Thread James Matthews
Very pythoninc! On 10/1/07, John Machin <[EMAIL PROTECTED]> wrote: > > On Oct 2, 6:27 am, brad <[EMAIL PROTECTED]> wrote: > > Is this the correct way to slice the last 4 items from a list? > > > > x = [1,2,3,4,5,6,7,8,9] > > print x[-4:] > > > > It works, but is it Pythonic? > > It's Pythonic. It'

Re: Using fractions instead of floats

2007-10-01 Thread Robert Kern
[EMAIL PROTECTED] wrote: > On Oct 1, 8:17?pm, [EMAIL PROTECTED] wrote: >> On Oct 1, 9:03 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >> >>> On Oct 1, 7:20 pm, [EMAIL PROTECTED] wrote: On Oct 1, 8:30 am, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > >>> mpq(1,3)+0.6 > mpq(14,1

Re: Using fractions instead of floats

2007-10-01 Thread Rhamphoryncus
On Sep 30, 7:35 pm, andresj <[EMAIL PROTECTED]> wrote: > I was doing some programming in Python, and the idea came to my mind: > using fractions instead of floats when doing 2/5. The core problem with rationals (other than the inability to handle irrationals) is their tendency to require more and

Wrapper functions and arguments

2007-10-01 Thread Jeremy Sanders
One little issue I have is to write a little wrapper which can generally pass standard and keyword arguments to a callee: def a(x, y, z): print x, y, z def b(x, y, z='fruitbat') print x, y, z for func in a, b: def wrapper(func=func, *args, **argsk): # do something func(*args, **ar

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-10-01 Thread George Neuner
On Tue, 02 Oct 2007 01:16:25 +0100, [EMAIL PROTECTED] wrote: >Ken Tilton wrote: >> Kenny happened to solve the traveling >> salesman problem and protein-folding and passed the fricking Turing test >> by using add-42 wherever he needed 42 added to a number, and RMS wants >> credit and ownership

Re: module confusion

2007-10-01 Thread Robert Kern
[EMAIL PROTECTED] wrote: > On Oct 1, 10:03?pm, rjcarr <[EMAIL PROTECTED]> wrote: >> Sorry if this is a completely newbie question ... >> >> I was trying to get information about the logging.handlers module, so >> I imported logging, and tried dir(logging.handlers), but got: >> >> AttributeError: 'm

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-10-01 Thread George Neuner
On Tue, 02 Oct 2007 03:38:08 GMT, Roedy Green <[EMAIL PROTECTED]> wrote: >On Fri, 28 Sep 2007 18:27:04 -0500, Damien Kick <[EMAIL PROTECTED]> >wrote, quoted or indirectly quoted someone who said : > >>"free as in beer". > >but does not "free beer" nearly always come with a catch or implied >obli

Re: Using fractions instead of floats

2007-10-01 Thread [EMAIL PROTECTED]
On Oct 1, 8:17?pm, [EMAIL PROTECTED] wrote: > On Oct 1, 9:03 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > On Oct 1, 7:20 pm, [EMAIL PROTECTED] wrote: > > > > On Oct 1, 8:30 am, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > > > > > >>> mpq(1,3)+0.6 > > > > mpq(14,15) > > > > Golly! T

Re: gui toolkits: the real story? (Tkinter, PyGTK, etc.)

2007-10-01 Thread Robert Kern
bramble wrote: > On Oct 1, 10:34 pm, Benjamin <[EMAIL PROTECTED]> wrote: >> and they are still supported >> not to break compatability. > > Hm. Ok. I can see that for the 2.x releases. But Py3k is all about > breaking compatibility, so, it would seem there's more to the story. Yes, compatibility

Re: module confusion

2007-10-01 Thread [EMAIL PROTECTED]
On Oct 1, 10:03?pm, rjcarr <[EMAIL PROTECTED]> wrote: > Sorry if this is a completely newbie question ... > > I was trying to get information about the logging.handlers module, so > I imported logging, and tried dir(logging.handlers), but got: > > AttributeError: 'module' object has no attribute 'h

Re: Why doesn't Python's "robotparser" like Wikipedia's "robots.txt" file?

2007-10-01 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, John Nagle wrote: > For some reason, Python's parser for "robots.txt" files > doesn't like Wikipedia's "robots.txt" file: > > >>> import robotparser > >>> url = 'http://wikipedia.org/robots.txt' > >>> chk = robotparser.RobotFileParser() > >>> chk.set_url(ur

LastWriteTime in windows registry

2007-10-01 Thread Peters, Matthew J. ET3
Hi, I'm looking for a way to read the lastwritetime property of a windows registry key. I've tried searching google a ton, but lastwritetime also applies to files as well, so search results are never what I intended. I found the function in perl, but the program is in python and I w

Re: Python 3.0 migration plans?

2007-10-01 Thread Terry Reedy
"NickC" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | When 3.0b1 comes out is probably the time to start looking seriously | at conversion. Until then, major course corrections (like PEP 3137) | will still be a possibility. Before the first beta, the best idea is | probably just t

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-10-01 Thread Roedy Green
On Fri, 28 Sep 2007 18:27:04 -0500, Damien Kick <[EMAIL PROTECTED]> wrote, quoted or indirectly quoted someone who said : >"free as in beer". but does not "free beer" nearly always come with a catch or implied obligation? -- Roedy Green Canadian Mind Products The Java Glossary http://mindprod.

Why doesn't Python's "robotparser" like Wikipedia's "robots.txt" file?

2007-10-01 Thread John Nagle
For some reason, Python's parser for "robots.txt" files doesn't like Wikipedia's "robots.txt" file: >>> import robotparser >>> url = 'http://wikipedia.org/robots.txt' >>> chk = robotparser.RobotFileParser() >>> chk.set_url(url) >>> chk.read() >>> testurl = 'http://wikipedia.org' >>> chk

Re: Using fractions instead of floats

2007-10-01 Thread Terry Reedy
"andresj" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] || I know from __future__ import division changes the behaivour to return | floats instead of ints, but what I meant is to be able to implement a | function (or class/method) which would return what _I_ want/decide. When you d

Re: Question about quoting style.

2007-10-01 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Steven W. Orr wrote: > foo=bar # No quotes needed > echo $foo # Also none needed Actually, it's not clear to me that quotes will never be needed on the second line. Unless foo is always going to have the value "bar". -- http://mai

Re: New to python

2007-10-01 Thread rjcarr
On Sep 29, 9:20 pm, Googy <[EMAIL PROTECTED]> wrote: > I am new to python... > > The programming language i know well is C > Can any one recommend me the good ebook for beginners. I have loads of > ebooks but i am not able to decide which to start with which book. > Also i am learning XML so later

Re: gui toolkits: the real story? (Tkinter, PyGTK, etc.)

2007-10-01 Thread bramble
On Oct 1, 10:34 pm, Benjamin <[EMAIL PROTECTED]> wrote: > and they are still supported > not to break compatability. Hm. Ok. I can see that for the 2.x releases. But Py3k is all about breaking compatibility, so, it would seem there's more to the story. -- http://mail.python.org/mailman/listinfo/

module confusion

2007-10-01 Thread rjcarr
Sorry if this is a completely newbie question ... I was trying to get information about the logging.handlers module, so I imported logging, and tried dir(logging.handlers), but got: AttributeError: 'module' object has no attribute 'handlers' The only experience I have in modules is os and os.pat

Re: gui toolkits: the real story? (Tkinter, PyGTK, etc.)

2007-10-01 Thread bramble
On Oct 1, 10:54 pm, bramble <[EMAIL PROTECTED]> wrote: > > BTW, pulling Tkinter and related GUI stuff out of Py3k's standard > library wouldn't harm existing Tkinter users -- it would merely > require them to actually install it if they want it. Oops. I meant to put in there, after the "BTW,": "it

Re: gui toolkits: the real story? (Tkinter, PyGTK, etc.)

2007-10-01 Thread bramble
On Oct 1, 9:14 pm, Paul Rubin wrote: > bramble <[EMAIL PROTECTED]> writes: > > Maybe a better question is, how has Tk managed to keep beating up the > > newer, more modern, more featureful, better documented toolkits > > encroaching on his territory? What's Tk's secret we

Re: gui toolkits: the real story? (Tkinter, PyGTK, etc.)

2007-10-01 Thread Benjamin
On Oct 1, 8:04 pm, bramble <[EMAIL PROTECTED]> wrote: > What is the backstory to why Python includes Tk bindings, as opposed > to some other set of bindings? > > I've written a few little Tkinter-based apps, and it's nice and > simple. I like it well enough. That said though, I keep feeling the > g

Re: How to display a videostream in the PyQt GUI by a efficient way

2007-10-01 Thread kivilaya
Hi, David! ^__^ Your advice makes me know the important thing of my question is the way I get the source video. I do this on the Windows XP operating system, and make these changes on a live video stream. And I think you are right, the conversion process takes most part of the time, and the r

Re: Limits on search length

2007-10-01 Thread John Machin
On Oct 2, 3:16 am, Daryl Lee <[EMAIL PROTECTED]> wrote: > I am trying to locate all lines in a suite of files with quoted strings of > particular lengths. A search pattern like r'".{15}"' finds 15-character > strings very nicely. But I have some very long ones, and a pattern like > r'".{272}"' fa

Re: I earn $36800 a month with google adsense

2007-10-01 Thread panguohua
On 10 1 , 8 06 , panguohua <[EMAIL PROTECTED]> wrote: > On 10 1 , 1 13 , panguohua <[EMAIL PROTECTED]> wrote: > > >www.space666.com > > > a good website for making money with your blog.more information there > > support! > ! good -- http://mail.pyt

Re: Using fractions instead of floats

2007-10-01 Thread richyjsm
On Oct 1, 9:03 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Oct 1, 7:20 pm, [EMAIL PROTECTED] wrote: > > > On Oct 1, 8:30 am, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > > > > >>> mpq(1,3)+0.6 > > > mpq(14,15) > > > Golly! That's quite impressive. And more than a little bit magic

Re: gui toolkits: the real story? (Tkinter, PyGTK, etc.)

2007-10-01 Thread Paul Rubin
bramble <[EMAIL PROTECTED]> writes: > Maybe a better question is, how has Tk managed to keep beating up the > newer, more modern, more featureful, better documented toolkits > encroaching on his territory? What's Tk's secret weapon? First-mover advantage. -- http://mail.python.org/mailman/listinf

gui toolkits: the real story? (Tkinter, PyGTK, etc.)

2007-10-01 Thread bramble
What is the backstory to why Python includes Tk bindings, as opposed to some other set of bindings? I've written a few little Tkinter-based apps, and it's nice and simple. I like it well enough. That said though, I keep feeling the gravitational pull toward GTK+. I've been meaning to get the whole

Re: Using fractions instead of floats

2007-10-01 Thread [EMAIL PROTECTED]
On Oct 1, 7:20 pm, [EMAIL PROTECTED] wrote: > On Oct 1, 8:30 am, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > > > >>> mpq(1,3)+0.6 > > mpq(14,15) > > Golly! That's quite impressive. And more than a little bit magic as > well, since 0.6 is definitely not the same as 3/5. It's not? Since whe

Re: Using fractions instead of floats

2007-10-01 Thread [EMAIL PROTECTED]
On Oct 1, 7:09 pm, andresj <[EMAIL PROTECTED]> wrote: > > > On 2007-10-01, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > > > > > Finally, arithmetic would become very confusing if there were > > > > three distinct numeric types; it already causes enough > > > > confusion with two! > > Well, yeah...

Re: slice last 4 items from a list

2007-10-01 Thread John Machin
On Oct 2, 6:27 am, brad <[EMAIL PROTECTED]> wrote: > Is this the correct way to slice the last 4 items from a list? > > x = [1,2,3,4,5,6,7,8,9] > print x[-4:] > > It works, but is it Pythonic? It's Pythonic. It's also unambiguous, unlike your specification, which could be interpreted as 'chop off

Re: Question about quoting style.

2007-10-01 Thread J. Cliff Dyer
Bruno Desthuilliers wrote: > Steven W. Orr a écrit : > >> Python has a number of "quoting" 'options' to help """with >> times when""" one way may be more convenient than another. >> >> In the world of shell scripting, I use a technique that I call minimal >> quoting. It works like this: >> >> f

Re: Using fractions instead of floats

2007-10-01 Thread richyjsm
On Oct 1, 8:30 am, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > >>> mpq(1,3)+0.6 > mpq(14,15) Golly! That's quite impressive. And more than a little bit magic as well, since 0.6 is definitely not the same as 3/5. How on earth does this work? Richard -- http://mail.python.org/mailman/list

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-10-01 Thread dan
Ken Tilton wrote: > Kenny happened to solve the traveling > salesman problem and protein-folding and passed the fricking Turing test > by using add-42 wherever he needed 42 added to a number, and RMS wants > credit and ownership and control of it all. That might be what RMS wants (or not, I'v

Re: Reentrancy of Python interpreter

2007-10-01 Thread Brad Johnson
Hrvoje Niksic xemacs.org> writes: > > Brad Johnson ballardtech.com> writes: > > > I have a place where I execute a Python command that calls into C++ > > code which then in turn calls back into Python using the same > > interpreter. I get a fatal error which is "PyThreadStage_Get: no > > curre

Re: Using fractions instead of floats

2007-10-01 Thread andresj
> > On 2007-10-01, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > > > > Finally, arithmetic would become very confusing if there were > > > three distinct numeric types; it already causes enough > > > confusion with two! Well, yeah... I get what you are saying, that would be confusing... Terry Re

Re: Question about quoting style.

2007-10-01 Thread Gabriel Genellina
En Mon, 01 Oct 2007 19:10:11 -0300, James Stroud <[EMAIL PROTECTED]> escribi�: > Bruno Desthuilliers wrote: >> First point is that Python has no "variable interpolation". > > If you squint, it kind of does*: > > >>> print '%(language)s has %(#)03d quote types.' % \ > {'language

Re: Question about quoting style.

2007-10-01 Thread Carsten Haese
On Mon, 2007-10-01 at 15:10 -0700, James Stroud wrote: > Bruno Desthuilliers wrote: > > First point is that Python has no "variable interpolation". > > If you squint, it kind of does*: > > >>> print '%(language)s has %(#)03d quote types.' % \ > {'language': "Python", "#": 2} >

Re: Cross-platform time out decorator

2007-10-01 Thread Gabriel Genellina
En Mon, 01 Oct 2007 04:34:38 -0300, Joel <[EMAIL PROTECTED]> escribi�: > On Sep 27, 10:40 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: >> You can use ctypes and the Python API to raise a Python exception in >> the thread. > Could you point me to an example of how to do that? Found this:

Displaying images in python shell

2007-10-01 Thread Roberto Montes
Good afternoon, I am trying to display images directly in python shell using an image library, however, I can only get to open an image on windows image viewer through python. Is that the only way to display images in python, or is there a way to display an image directly along with the code? Than

Algebraic Modules For Python

2007-10-01 Thread Brandon McGinty
Hi All, I know that there is probably a great deal of literature on this on the net, but I don't have any time to go searching. Does anyone have any suggestions for modules that will allow python to do the functions of a graphing calculator or similar device, performing operations on matricies, gra

Re: where is pkg_resources (setuptools) looking for entry_points.txt

2007-10-01 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Hi, > I'm trying to use an egg packages (pyOpenGL) as a "normal > package" (by unzipping the egg into a directory). > Generally this seems to work fine, except one init-step is missing. The EGG-INFO/ directory in the zipped egg needs to be renamed to something appropria

Re: Python and SSL

2007-10-01 Thread Martin v. Löwis
> Actually, the SSL certificate has to be in valid format, because > OpenSSL does require that. Sure. However, in the first message, the OP mentioned that he gets error 503. That tells me that the SSL connection had been established successfully, and that he was actually seeing a HTTP error

Re: Limits on search length

2007-10-01 Thread Paul Hankin
On Oct 1, 6:16 pm, Daryl Lee <[EMAIL PROTECTED]> wrote: > I am trying to locate all lines in a suite of files with quoted strings of > particular lengths. A search pattern like r'".{15}"' finds 15-character > strings very nicely. But I have some very long ones, and a pattern like > r'".{272}"' fa

Re: Question about quoting style.

2007-10-01 Thread James Stroud
Bruno Desthuilliers wrote: > First point is that Python has no "variable interpolation". If you squint, it kind of does*: >>> print '%(language)s has %(#)03d quote types.' % \ {'language': "Python", "#": 2} Python has 002 quote types. You might think if the dict as a name s

Re: win32com COMAdminCatalogObject Value method

2007-10-01 Thread Roger Upole
rc wrote: > I'm trying to convert VB code that registers COM+ components to > Python. However, I'm unable to set values on COMAdminCatalogObject > using the Value() method, it seems to think I'm trying to call the get > method. > > VB Code: > Dim cat As COMAdminCatalog > Set cat = New COMAdminCata

where is pkg_resources (setuptools) looking for entry_points.txt

2007-10-01 Thread seb . haase
Hi, I'm trying to use an egg packages (pyOpenGL) as a "normal package" (by unzipping the egg into a directory). Generally this seems to work fine, except one init-step is missing. >From setuptools I got the pkg_resources.py file. But now the package is not properly initialized, because iter_entry

Re: Python 3.0 migration plans?

2007-10-01 Thread NickC
On Sep 30, 2:29 am, John Roth <[EMAIL PROTECTED]> wrote: > I was thinking of starting work on converting Python FIT to 3.0, and > then they posted PEP 3137. I think it's a real good idea, but it shows > that 3.0a1 isn't ready for a conversion effort. > > http://www.python.org/dev/peps/pep-3137/ > >

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-10-01 Thread Wildemar Wildenburger
Frank Goenninger wrote: > On 2007-09-29 01:27:04 +0200, Damien Kick <[EMAIL PROTECTED]> said: > >> If you were referring to the "free" in "free Mumia Abu Jamal", I would >> agree with you. I don't think anyone would imagine that this phrase >> meant that someone was going to get Mumia Abu Jamal

Re: Using fractions instead of floats

2007-10-01 Thread Arnaud Delobelle
On Oct 1, 6:26 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-10-01, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > > > Finally, arithmetic would become very confusing if there were > > three distinct numeric types; it already causes enough > > confusion with two! > > Scheme says: It's not th

pywin32/win32com float/double coercion

2007-10-01 Thread mazerj2006
I'm an old hand at python, but totally new to win32com -- I've run into a snag that seems to be related to python's (usually handy) lack of distinction between floats and doubles. Can anyone explain to me (or point me towards the right docs) how the win32com module handles an ActiveX component that

Re: slice last 4 items from a list

2007-10-01 Thread Bruno Desthuilliers
brad a écrit : > Is this the correct way to slice the last 4 items from a list? > > x = [1,2,3,4,5,6,7,8,9] > print x[-4:] > > It works, but is it Pythonic? Is there a more obvious (for a pythonic definition of 'obvious') way to do it ? If no, then it's pythonic... Now FWIW, I usually use 'esr

slice last 4 items from a list

2007-10-01 Thread brad
Is this the correct way to slice the last 4 items from a list? x = [1,2,3,4,5,6,7,8,9] print x[-4:] It works, but is it Pythonic? -- http://mail.python.org/mailman/listinfo/python-list

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-10-01 Thread Bruno Desthuilliers
Ken Tilton a écrit : > > > Matthias Benkard wrote: > >>> So this has nothing to >>> do with freedom in /any/ sense of the word, it has to do with a >>> political agenda opposed to the idea of private property. >> >> Freedom is inherently political, you know. You're condemning the FSF >> for bei

Re: Question about quoting style.

2007-10-01 Thread Bruno Desthuilliers
Steven W. Orr a écrit : > Python has a number of "quoting" 'options' to help """with > times when""" one way may be more convenient than another. > > In the world of shell scripting, I use a technique that I call minimal > quoting. It works like this: > > foo=bar# No quotes needed >

Question about quoting style.

2007-10-01 Thread Steven W. Orr
Python has a number of "quoting" 'options' to help """with times when""" one way may be more convenient than another. In the world of shell scripting, I use a technique that I call minimal quoting. It works like this: foo=bar # No quotes needed echo $foo # Also none

Re: Limits on search length

2007-10-01 Thread Roger Miller
Since you are getting the regular expression pattern via an argument I would first check that searchPattern is what you expect. Shells can do funny things with arguments containing special characters. Also, is it possible that the quoted strings in the files contain escapes? For example if a file

Re: image python

2007-10-01 Thread Florian Schmidt
On Mon, Oct 01, 2007 at 11:21:09AM -0700, [EMAIL PROTECTED] wrote: > hi > I want understanding pictures colorfull > for examle colorfull or black-white > image.google.com there are understand it. i'm not sure if i understand your question. assuming you want to decide if an image has only grayscale

Re: Reentrancy of Python interpreter

2007-10-01 Thread Hrvoje Niksic
Brad Johnson <[EMAIL PROTECTED]> writes: > I have a place where I execute a Python command that calls into C++ > code which then in turn calls back into Python using the same > interpreter. I get a fatal error which is "PyThreadStage_Get: no > current thread." Does the C++ code call into the inte

Re: how to install numpy and scipy on debian?

2007-10-01 Thread Robert Kern
wang frank wrote: > > Hi, > > I need to help to install these two packages on debian. I want to know > what packages do I need to? I have installed fftw3,fftww2, sfftw2, > atlas. Did I miss anything? In what way I can install an optimized numpy > and scipy, since my project is very big and speed

Re: Combine two dictionary...

2007-10-01 Thread Tim Chase
>> I want to total score.. >> For example dict1={1: 4, 3: 5}... and 2 millions element dict2={3: 3, 8: 6}... and 3 millions element >> result should be dict3={1:4, 3:8, 8:6} > > Well not sure how this will work with 5+ million elements, but here's > one stab at it: > > >>> dict1

Re: Reentrancy of Python interpreter

2007-10-01 Thread Brad Johnson
yahoo.com> writes: > Looks like ( from PyThreadStage_Get error ) that you lost the GIL. You > probably > entered some C++ code and encapsulated you're work in the > > Py_BEGIN_ALLOW_THREADS > > Py_END_ALLOW_THREADS > > but you're is calling back the Python function, and you forgot > to acqui

Re: Limits on search length

2007-10-01 Thread Florian Schmidt
On Mon, Oct 01, 2007 at 08:33:28PM +0200, Florian Schmidt wrote: > could you post your searchPattern? sorry. now i see you already posted your search pattern!:) r".{272}" -- Florian Schmidt // www.fastflo.de -- http://mail.python.org/mailman/listinfo/python-list

Re: Limits on search length

2007-10-01 Thread Hrvoje Niksic
Daryl Lee <[EMAIL PROTECTED]> writes: > I am trying to locate all lines in a suite of files with quoted > strings of particular lengths. A search pattern like r'".{15}"' > finds 15-character strings very nicely. But I have some very long > ones, and a pattern like r'".{272}"' fails miserably, ev

Re: Combine two dictionary...

2007-10-01 Thread Ian Clark
Abandoned wrote: > On 1 Ekim, 20:41, Carsten Haese <[EMAIL PROTECTED]> wrote: >> On Mon, 2007-10-01 at 10:24 -0700, Abandoned wrote: >>> Hi.. >>> dict1={1: 4, 3: 5}... and 2 millions element >>> dict2={3: 3, 8: 6}... and 3 millions element >>> I want to combine dict1 and dict2 and i don't want to

Re: Limits on search length

2007-10-01 Thread Florian Schmidt
On Mon, Oct 01, 2007 at 11:16:49AM -0600, Daryl Lee wrote: > ... But I have some very long ones, and a pattern like > r'".{272}"' fails miserably, even though I know I have at least one > 272-character string. ~>python Python 2.4.4 (#2, Apr 26 2007, 00:02:45) [GCC 4.1.2 20061115 (prerelease) (D

Re: Combine two dictionary...

2007-10-01 Thread Bruno Desthuilliers
Abandoned a écrit : > > I'm sorry my bed english. Time to go to bad, then !-) (sorry, couldn't resist) -- http://mail.python.org/mailman/listinfo/python-list

image python

2007-10-01 Thread [EMAIL PROTECTED]
hi I want understanding pictures colorfull for examle colorfull or black-white image.google.com there are understand it .Can I understand it thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Combine two dictionary...

2007-10-01 Thread Abandoned
On 1 Ekim, 20:41, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Mon, 2007-10-01 at 10:24 -0700, Abandoned wrote: > > Hi.. > > dict1={1: 4, 3: 5}... and 2 millions element > > dict2={3: 3, 8: 6}... and 3 millions element > > > I want to combine dict1 and dict2 and i don't want to use FOR because >

Re: Combine two dictionary...

2007-10-01 Thread Raymond Hettinger
On Oct 1, 10:24 am, Abandoned <[EMAIL PROTECTED]> wrote: > Hi.. > dict1={1: 4, 3: 5}... and 2 millions element > dict2={3: 3, 8: 6}... and 3 millions element > > I want to combine dict1 and dict2 and i don't want to use FOR because > i need to performance. The dict.update approach is the fastest

how to install numpy and scipy on debian?

2007-10-01 Thread wang frank
Hi, I need to help to install these two packages on debian. I want to know what packages do I need to? I have installed fftw3,fftww2, sfftw2, atlas. Did I miss anything? In what way I can install an optimized numpy and scipy, since my project is very big and speed is important. Thanks Fra

Re: Combine two dictionary...

2007-10-01 Thread Carsten Haese
On Mon, 2007-10-01 at 10:24 -0700, Abandoned wrote: > Hi.. > dict1={1: 4, 3: 5}... and 2 millions element > dict2={3: 3, 8: 6}... and 3 millions element > > I want to combine dict1 and dict2 and i don't want to use FOR because > i need to performance. You'll have to be a bit more precise here a

Re: Combine two dictionary...

2007-10-01 Thread Tim Chase
> dict1={1: 4, 3: 5}... and 2 millions element > dict2={3: 3, 8: 6}... and 3 millions element > > I want to combine dict1 and dict2 and i don't want to use FOR because > i need to performance. If you combine your dict1 and dict2 to become result_dict, what should the result of result_dict[3] b

Re: Combine two dictionary...

2007-10-01 Thread Stargaming
On Mon, 01 Oct 2007 10:24:39 -0700, Abandoned wrote: > Hi.. > dict1={1: 4, 3: 5}... and 2 millions element dict2={3: 3, 8: 6}... and > 3 millions element > > I want to combine dict1 and dict2 and i don't want to use FOR because i > need to performance. > > I'm sorry my bed english. > King rega

Re: which language allows you to change an argument's value?

2007-10-01 Thread Scott Gifford
Summercool <[EMAIL PROTECTED]> writes: > I wonder which language allows you to change an argument's value? [...] > What about Java and Perl? Perl will let you change the value of a passed-in object directly. Others have already answered about Java. > is there any way to prevent a function from

Re: Using fractions instead of floats

2007-10-01 Thread Neil Cerutti
On 2007-10-01, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > Finally, arithmetic would become very confusing if there were > three distinct numeric types; it already causes enough > confusion with two! Scheme says: It's not that bad. -- Neil Cerutti I am free of all prejudices. I hate everyone e

Re: Overriding Logging Config FileHandler Filename

2007-10-01 Thread Kenneth Love
> On Sep 26, 1:07 am, "Vinay Sajip" <[EMAIL PROTECTED]> wrote: >> On Sep 25, 9:15 pm, "Kenneth Love" <[EMAIL PROTECTED]> wrote: >> I have a Pythonloggingconfig file that contains a RotatingFileHandler >> handler. In the args key, I have hard-coded the log filename. >> Everything >> works great. >

Combine two dictionary...

2007-10-01 Thread Abandoned
Hi.. dict1={1: 4, 3: 5}... and 2 millions element dict2={3: 3, 8: 6}... and 3 millions element I want to combine dict1 and dict2 and i don't want to use FOR because i need to performance. I'm sorry my bed english. King regards.. -- http://mail.python.org/mailman/listinfo/python-list

Limits on search length

2007-10-01 Thread Daryl Lee
I am trying to locate all lines in a suite of files with quoted strings of particular lengths. A search pattern like r'".{15}"' finds 15-character strings very nicely. But I have some very long ones, and a pattern like r'".{272}"' fails miserably, even though I know I have at least one 272-ch

Re: Select as dictionary...

2007-10-01 Thread Carsten Haese
On Mon, 2007-10-01 at 10:13 -0700, Abandoned wrote: > Also if i need a list id what can i do ? > > aia.execute("SELECT id, w from list") > links=aia.fetchall() > > I want to.. > > idlist=[1, 2, 3] ( I don't want to use FOR and APPEND because the > query have 2 million result and i want to speed)

Re: Python and SSL

2007-10-01 Thread John Nagle
Martin v. Löwis wrote: >>> No, as Martin points out, Python trusts EVERY certificate, which of >>> course misses the whole point of certificates. Whatever is making >>> your program fail is something different. >> Paul, are you sure for 100%. It is hard to belive. > > Not sure how many confirmati

Re: Select as dictionary...

2007-10-01 Thread Diez B. Roggisch
Abandoned wrote: > Also if i need a list id what can i do ? > > aia.execute("SELECT id, w from list") > links=aia.fetchall() > > I want to.. > > idlist=[1, 2, 3] ( I don't want to use FOR and APPEND because the > query have 2 million result and i want to speed) It will always return a list of

Re: Select as dictionary...

2007-10-01 Thread Abandoned
Also if i need a list id what can i do ? aia.execute("SELECT id, w from list") links=aia.fetchall() I want to.. idlist=[1, 2, 3] ( I don't want to use FOR and APPEND because the query have 2 million result and i want to speed) -- http://mail.python.org/mailman/listinfo/python-list

Re: Select as dictionary...

2007-10-01 Thread Abandoned
On 1 Ekim, 18:13, Bruno Desthuilliers wrote: > J. Clifford Dyer a écrit : > > > On Mon, Oct 01, 2007 at 03:50:59PM +0200, Bruno Desthuilliers wrote > > regarding Re: Select as dictionary...: > >> IIRC, postgres' db-api connector (well, at least one of them - I don't > >> know which one you're usi

Re: using inspect on pygtk

2007-10-01 Thread Chris Pax
On Oct 1, 12:53 pm, "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote: > On 9/29/07, Chris Pax <[EMAIL PROTECTED]> wrote: > > > Hello, > > > I recently been trying to use the inspect module to inspect the > > arguments of gtk objects, such as gtk.Button. I tried like this: > > > inspect.getargspec(gtk.Bu

Re: Setting value of Python variable in a Python C extension

2007-10-01 Thread Carsten Haese
On Mon, 2007-10-01 at 09:42 -0700, MD wrote: > Hi Carsten, > Thanks for your reply. I am a newbie on Python so your help is > much appreciated. My program structure is basically like this . > (rough representation) > test.py >var1 = "" >rc = func1 (var1) > > test.c > func1(*v1)

Re: using inspect on pygtk

2007-10-01 Thread BJörn Lindqvist
On 9/29/07, Chris Pax <[EMAIL PROTECTED]> wrote: > Hello, > > I recently been trying to use the inspect module to inspect the > arguments of gtk objects, such as gtk.Button. I tried like this: > > inspect.getargspec(gtk.Button.__init__) > > and get the fallowing error: > > File "", line 1, in >

Re: Program inefficiency?

2007-10-01 Thread Florian Schmidt
On Sat, Sep 29, 2007 at 12:05:26PM -0700, thebjorn wrote: > Ok, if you want a single RE... How about: >... > r = re.compile(r''' > (?:href=['"][^#]+[#]([^"']+)["']) > | (?:name=['"]?([^'">]+)) > ''', re.IGNORECASE | re.MULTILINE | re.DOTALL | re.VERBOSE) maybe a little bit easier to

Re: Setting value of Python variable in a Python C extension

2007-10-01 Thread MD
Hi Carsten, Thanks for your reply. I am a newbie on Python so your help is much appreciated. My program structure is basically like this . (rough representation) test.py var1 = "" rc = func1 (var1) test.c func1(*v1) { strcpy(v1, "Hello World"); } So basically I want to modif

Re: Python and SSL

2007-10-01 Thread Martin v. Löwis
>> No, as Martin points out, Python trusts EVERY certificate, which of >> course misses the whole point of certificates. Whatever is making >> your program fail is something different. > > Paul, are you sure for 100%. It is hard to belive. Not sure how many confirmations you want, but I can add

Re: Setting value of Python variable in a Python C extension

2007-10-01 Thread Carsten Haese
On Mon, 2007-10-01 at 09:08 -0700, MD wrote: > Hi, >I have a function developed in C that is being used as a Python > extension. The function is being passed a variable from the Python > program. Is it possible to change the value of this variable from > within the C function? That question is

Re: Using fractions instead of floats

2007-10-01 Thread Arnaud Delobelle
On Oct 1, 2:35 am, andresj <[EMAIL PROTECTED]> wrote: [snip Rational numbers in Python] > I would like to get some feedback on this idea. Has this been posted > before? If so, was it rejected? and for what? > Also, I would like to know if you have improvements on the initial > design, and if it w

Setting value of Python variable in a Python C extension

2007-10-01 Thread MD
Hi, I have a function developed in C that is being used as a Python extension. The function is being passed a variable from the Python program. Is it possible to change the value of this variable from within the C function? Thanks, -MD -- http://mail.python.org/mailman/listinfo/python-list

ANNOUNCE: Wing IDE 3.0 released

2007-10-01 Thread Wingware
Hi, We're happy to announce the release of Wing IDE 3.0, an advanced development environment for the Python programming language. It is available from: http://wingware.com/ Wing IDE provides powerful debugging, editing, code intelligence, testing, and search capabilities that reduce development

Re: Select as dictionary...

2007-10-01 Thread Bruno Desthuilliers
J. Clifford Dyer a écrit : > On Mon, Oct 01, 2007 at 03:50:59PM +0200, Bruno Desthuilliers wrote regarding > Re: Select as dictionary...: >> IIRC, postgres' db-api connector (well, at least one of them - I don't >> know which one you're using) has a DictCursor. You should find all you >> want to

Re: How popular is Django ?

2007-10-01 Thread Bruno Desthuilliers
Diez B. Roggisch a écrit : > [EMAIL PROTECTED] wrote: > >> Hi! >> >> I was surprised when I did a google-groups search for python, >> ( >> http://groups.google.com/groups/search?q=python&qt_s=Search+Groups >> ) >> it shows these groups: >> comp.lang.python with about 11000 users, >> and second,

  1   2   >