Parallelization in Python at the Regular Toronto and Area Python User's Group September 15th

2009-09-09 Thread Mike C. Fletcher
We'll be having our regular Toronto Area Python User's group meeting at Linux Caffe on Tuesday the 15th of September at 7:05pm. Parallelization in Python: Code Samples, Experiences and Advocacy Unlike functional languages (Haskel, Erlang), where parallelization is baked into the

[ANN] Chicago Python User Group ChiPy September Meeting

2009-09-09 Thread Brian Ray
Chicago Python User Group = History, Tradition, Technology and Journalism meet this Thursday at one of our nations most historical landmarks, Tribune Tower--right off the Chicago River on the Magnificent Mile. This *new* venue speaks to the movement of journalism

Distribute 0.6.1 released

2009-09-09 Thread Tarek Ziadé
Hello I am happy to announce the release of Distribute 0.6.1. - What is Distribute ? Distribute is a friendly fork of the Setuptools project. More info at http://pypi.python.org/pypi/distribute and http://bitbucket.org/tarek/distribute/wiki/ - Changes: * zip_ok is now True by default. *

ANN: Leo 4.7 beta 1 released

2009-09-09 Thread Edward K Ream
Leo 4.7 beta 1 is now available at: http://sourceforge.net/project/showfiles.php?group_id=3458package_id=29106 Leo is a text editor, data organizer, project manager and much more. See: http://webpages.charter.net/edreamleo/intro.html This version of Leo is labeled a beta version because it

ANN: dh, the daemon helper 2009-09-04

2009-09-09 Thread John Kelly
dh, the daemon helper The daemon helper starts any program or script as a daemon. It's a small C program with a simple interface and a liberal license. ftp://ftp.isp2dial.com/users/jak/src/dh/ Get the files and do: make install clean To build and install dh. Don't try to run the

Re: Class variable inheritance

2009-09-09 Thread HPJ
http://docs.python.org/reference/datamodel.html#new-style-and-classic... - search for 'method resolution order' for other hits in that document. First of all, that's the LR for Python 2, I'm with Python 3. Second of all, there's one single passage containing the phrase method resolution order

Re: Class variable inheritance

2009-09-09 Thread HPJ
And by the way, the reason I've come across this problem at all is because I have something like this: class A: class X: n = 'a' x = X() class B(A): class X(A.X): n = 'b' # x = X() The line commented out was originally not there, but I found out I had to add it if I wanted B().x.n

Re: Class variable inheritance

2009-09-09 Thread Steven D'Aprano
On Tue, 08 Sep 2009 13:14:42 -0700, HPJ wrote: I could, but I will let you read and find what it says about class attributes. You think I would have asked specifically about the Language Reference if I hadn't read it and failed to find what I was looking for? You must be new to the

Re: Class variable inheritance

2009-09-09 Thread Carl Banks
On Sep 8, 8:51 pm, HPJ henrypija...@gmail.com wrote: Conceptually, Python checks for the presence of B.foo, and if it's not there it checks for foo's presence in the base classes. Yes, I have no problem believing you guys that this is what Python does. Still, my question remains about where

Re: Multiple inheritance - How to call method_x in InheritedBaseB from method_x in InheritedBaseA?

2009-09-09 Thread The Music Guy
I should also mention--and I should have realized this much sooner--that each of the BaseN classes are themselves each going to have at least one common base which will define method_x, so each BaseN will be calling that if it defines its own method_x. Again, sorry I didn't mention that sooner.

Re: Class variable inheritance

2009-09-09 Thread Carl Banks
On Sep 8, 11:05 pm, HPJ henrypija...@gmail.com wrote: And by the way, the reason I've come across this problem at all is because I have something like this: class A:   class X:     n = 'a'   x = X() class B(A):   class X(A.X):     n = 'b' # x = X() You've nested classes here, that's a

Re: Class variable inheritance

2009-09-09 Thread Chris Rebert
On Tue, Sep 8, 2009 at 11:30 PM, Steven D'Apranoste...@remove.this.cybersource.com.au wrote: snip Out of curiosity, are there languages where inheritance means copy? I think some prototype-based ones handle it that way... Cheers, Chris -- http://blog.rebertia.com --

Re: How do I post to the wxPython mailing list?

2009-09-09 Thread Neil Hodgson
PythonAB: No, but it means that more of my data goes into the same company. There's no way to use my own email accounts from my own domain, and I don't have a choice anymore. I just checked and it allowed me to use an account from my domain so I expect it will work with yours. In other

Re: Why does this group have so much spam?

2009-09-09 Thread Albert van der Horst
In article mailman.837.1251890913.2854.python-l...@python.org, Tino Wildenhain t...@wildenhain.de wrote: SNIP Here is another idea: for spam senders pointing to servers under=20 jurisdiction, size the server and check all incoming requests from users - if they try to do a deal, prosecute a few

Re: Extracting patterns after matching a regex

2009-09-09 Thread Mart.
On Sep 8, 4:33 pm, MRAB pyt...@mrabarnett.plus.com wrote: Mart. wrote: On Sep 8, 3:53 pm, MRAB pyt...@mrabarnett.plus.com wrote: Mart. wrote: On Sep 8, 3:14 pm, Andreas Tawn andreas.t...@ubisoft.com wrote: Hi, I need to extract a string after a matching a regular expression. For

Re: Re: Distutils - can user designate install directory for windows installer?

2009-09-09 Thread Timothy W. Grove
Mark Hammond wrote: div class=moz-text-flowed style=font-family: -moz-fixedOn 9/09/2009 1:57 AM, Timothy W. Grove wrote: I have successfully built a windows installer for my python program using distutils, (python setup.py bdist_wininst), but is there a way to do it that will allow a user

uses for setup.cfg and extracting data from it

2009-09-09 Thread Chris Withers
Hi All, Do people generally source control their package's setup.cfg? http://docs.python.org/distutils/configfile.html sort of implies it should be editable by the person installing the package, but I've never personally used a package where that's the case... Assuming the distutils docs

How can I format unicode strings?

2009-09-09 Thread gentlestone
return u{}.format(self.name) this one doesn't work on unicode strings. I there a not old formatting style possibilty for unicode strings? Note: self.name can be unicode string! -- http://mail.python.org/mailman/listinfo/python-list

[Tkinter] messed callbacks

2009-09-09 Thread Giacomo Boffi
i have this test program (that i already posted on it.comp.lang.python) [ test.py ] from Tkinter import * def output(s): print s def doit(fr,lst): for c1,c2 in zip(lst[::2], lst[1::2]): subframe=Frame(fr) Label(subframe,text=c1+' - '+c2).pack(side='left',expand=1,fill='both')

Re: [Tkinter] messed callbacks

2009-09-09 Thread Diez B. Roggisch
Giacomo Boffi wrote: i have this test program (that i already posted on it.comp.lang.python) [ test.py ] from Tkinter import * def output(s): print s def doit(fr,lst): for c1,c2 in zip(lst[::2], lst[1::2]): subframe=Frame(fr) Label(subframe,text=c1+' -

Re: How can I format unicode strings?

2009-09-09 Thread Tim Northover
gentlestone tibor.b...@hotmail.com writes: return u{}.format(self.name) this one doesn't work on unicode strings. I there a not old formatting style possibilty for unicode strings? It looks like you're trying to mix python 3.1 and 2.6. In 2.6 you have to put a number inside the {} to tell

Re: Class variable inheritance

2009-09-09 Thread HPJ
Maybe.  For some languages this might be an obvious behavior, but Python would have different circumstances so it isn't so obvious (or possible) there. Which means this topic definitely needs to be handled in detail by the LR, and preferably also in the Tutorial. Otherwise there is no way

Re: How can I format unicode strings?

2009-09-09 Thread Patrick Sabin
gentlestone schrieb: return u{}.format(self.name) u{0}.format(ublah) works for me with python-2.6.2 Maybe your format string is wrong. - Patrick -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I format unicode strings?

2009-09-09 Thread gentlestone
On 9. Sep., 12:31 h., Tim Northover t.p.northo...@sms.ed.ac.uk wrote: gentlestone tibor.b...@hotmail.com writes:  return u{}.format(self.name) this one doesn't work on unicode strings. I there a not old formatting style possibilty for unicode strings? It looks like you're trying to mix

Re: How can I format unicode strings?

2009-09-09 Thread Niklas Norrthon
On 9 Sep, 12:49, gentlestone tibor.b...@hotmail.com wrote: I have python 2.5 return u'{0}'.format(self.name) doesn't work eigther the error message i've got is: 'unicode' object has no attribute 'format' is the new formatting style newer then python 2.5? Yes. The new string formatting

Re: How can I format unicode strings?

2009-09-09 Thread Duncan Booth
gentlestone tibor.b...@hotmail.com wrote: the error message i've got is: 'unicode' object has no attribute 'format' is the new formatting style newer then python 2.5? Have you tried reading the documentation? It generally tells you which version of Python introduced a feature:

Re: [Tkinter] messed callbacks

2009-09-09 Thread Giacomo Boffi
Diez B. Roggisch de...@nospam.web.de writes: Giacomo Boffi wrote: def doit(fr,lst): for c1,c2 in zip(lst[::2], lst[1::2]): subframe=Frame(fr) Label(subframe,text=c1+' - '+c2).pack(side='left',expand=1,fill='both') Button(subframe,text='',command=lambda:

Some issue with easy_install and PIL/Imaging

2009-09-09 Thread Klein Stéphane
Hi, I would like to insert Imaging dependence in my setup.py file. Resume : 1. first question : why PIL package in pypi don't work ? 2. second question : when I add PIL dependence in my setup.py and I do python setup.py develop, I've this error : error: Could not find required

Re: [Tkinter] messed callbacks

2009-09-09 Thread Giacomo Boffi
Giacomo Boffi giacomo.bo...@polimi.it writes: ok, i'll try again following your advice ,[ test.py ] | from Tkinter import * | | def output(s): | print s | | def create_cb(a,b): | return lambda: output(a+'-'+b) | | def doit(fr,lst): | for c1,c2 in zip(lst[::2], lst[1::2]): |

Re: Extracting patterns after matching a regex

2009-09-09 Thread MRAB
Mart. wrote: On Sep 8, 4:33 pm, MRAB pyt...@mrabarnett.plus.com wrote: Mart. wrote: On Sep 8, 3:53 pm, MRAB pyt...@mrabarnett.plus.com wrote: Mart. wrote: On Sep 8, 3:14 pm, Andreas Tawn andreas.t...@ubisoft.com wrote: Hi, I need to extract a string after a matching a regular expression.

\r\n or \n notepad editor end line ???

2009-09-09 Thread Sphoorti.Patil
Hey Terry, That was a very useful tip I got about the Escape Sequences.. \r and \n Regards, Sphoorti Digambar Patil Software Engineer * SunGard * Technology Services * Embassy Icon 3, Infantry Road, Bangalore India * HOME - (205)969-1798*Tel +91-80--0501 * Extn 3154 * Fax

Re: [Guppy-pe-list] An iteration idiom (Was: Re: loading files containing multiple dumps)

2009-09-09 Thread Chris Withers
Sverker Nilsson wrote: But I don't think I would want to risk breaking someone's code just for this when we could just add a new method. I don't think anyone will be relying on StopIteration being raised. If you're worried, do the next release as a 0.10.0 release and explain the backwards

Re: uses for setup.cfg and extracting data from it

2009-09-09 Thread Ben Finney
Chris Withers ch...@simplistix.co.uk writes: Do people generally source control their package's setup.cfg? Yes. I prefer the distribution metadata to be declarative, for the reasons you touch on later in your message. So where it makes sense I store it in ‘setup.cfg’ or some other declarative

Re: Rapid GUI Programming with Python and Qt source code

2009-09-09 Thread David Boddie
On Wed Sep 9 07:11:26 CEST 2009, Steven Woody wrote: *I've searched google and cannot find a valid link for the source code of the book Rapid GUI Programming with Python and Qt. Could anyone please give me a non-broken URL?* See this page for the links: http://www.qtrac.eu/pyqtbook.html

Open Position: Software/System Engineer....Python....

2009-09-09 Thread James
Hello All I do not know if this is the correct forum. I am looking for a Software/System Engineer with Python experience in the Cleveland, OH area. The skill set looks like this: Skills/Qualifications: • Working in a dynamic, self motivated environment with minimal supervision in a small

Re: Open Position: Software/System Engineer....Python....

2009-09-09 Thread Diez B. Roggisch
James wrote: Hello All I do not know if this is the correct forum. I am looking for a Software/System Engineer with Python experience in the Cleveland, OH area. The skill set looks like this: Skills/Qualifications: • Working in a dynamic, self motivated environment with minimal

Re: Open Position: Software/System Engineer....Python....

2009-09-09 Thread Diez B. Roggisch
Diez B. Roggisch wrote: James wrote: Hello All I do not know if this is the correct forum. I am looking for a Software/System Engineer with Python experience in the Cleveland, OH area. The skill set looks like this: Skills/Qualifications: • Working in a dynamic, self motivated

Re: Open Position: Software/System Engineer....Python....

2009-09-09 Thread James
On Sep 9, 10:06 am, Diez B. Roggisch de...@nospam.web.de wrote: Diez B. Roggisch wrote: James wrote: Hello All I do not know if this is the correct forum.  I am looking for a Software/System Engineer with Python experience in the Cleveland, OH area.  The skill set looks like this:

Re: [Tkinter] messed callbacks

2009-09-09 Thread Scott David Daniels
Giacomo Boffi wrote: Giacomo Boffi giacomo.bo...@polimi.it writes: ... | def create_cb(a,b): | return lambda: output(a+'-'+b) | | def doit(fr,lst): | for c1,c2 in zip(lst[::2], lst[1::2]): | subframe=Frame(fr) | Label(subframe,text=c1+' -

Re: [Distutils] uses for setup.cfg and extracting data from it

2009-09-09 Thread P.J. Eby
At 11:25 PM 9/9/2009 +1000, Ben Finney wrote: That's one of the pain points of the current distutils capability: there's no standard-library way to extract that information. If you're talking about setup.cfg (and all the other distutils .cfg files), all you need to do is create a Distribution

Re: hanning python

2009-09-09 Thread pdpi
On Sep 9, 3:27 am, sturlamolden sturlamol...@yahoo.no wrote: On 9 Sep, 00:24, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: A decent vendor-supplied implementation will include error checking that you otherwise would need to implement yourself, so yes. Not for code like

ANNOUNCE: Leo 4.7 beta 1 released

2009-09-09 Thread Edward K Ream
Leo 4.7 beta 1 is now available at: http://sourceforge.net/project/showfiles.php?group_id=3458package_id=29106 Leo is a text editor, data organizer, project manager and much more. See: http://webpages.charter.net/edreamleo/intro.html This version of Leo is labeled a beta version because it

Re: hanning python

2009-09-09 Thread pdpi
On Sep 9, 3:46 pm, pdpi pdpinhe...@gmail.com wrote: On Sep 9, 3:27 am, sturlamolden sturlamol...@yahoo.no wrote: On 9 Sep, 00:24, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: A decent vendor-supplied implementation will include error checking that you otherwise would

logging sound / speech handler?

2009-09-09 Thread Gregor Horvath
Hi, For an application in an industrial environment where the workers are not always sitting in front of the monitor, but are within earshot of the PC I would need an sound / speech handler for the standard logging system. It should beep or better say the logging message. (with standard filtering

Less APIs or more encapsulation?

2009-09-09 Thread 一首诗
2 class, B contains C. When user want to use some service of C, there are two choice: First, more encapsulation: = class B: def newMethod(self): self.c.newMethod() class C: def newMethod(self): #do something pass b.newMethod()

Re: Less APIs or more encapsulation?

2009-09-09 Thread Diez B. Roggisch
一首诗 wrote: 2 class, B contains C. When user want to use some service of C, there are two choice: First, more encapsulation: = class B: def newMethod(self): self.c.newMethod() class C: def newMethod(self): #do something

Re: [Tkinter] messed callbacks

2009-09-09 Thread Terry Reedy
Giacomo Boffi wrote: Diez B. Roggisch de...@nospam.web.de writes: Giacomo Boffi wrote: def doit(fr,lst): for c1,c2 in zip(lst[::2], lst[1::2]): subframe=Frame(fr) Label(subframe,text=c1+' - '+c2).pack(side='left',expand=1,fill='both') Button(subframe,text='',command=lambda:

Re: a question about numpy

2009-09-09 Thread Robert Kern
On 2009-09-08 20:45 PM, hi_roger wrote: hello, i want to ask a question about numpy. i know how to select a submatrix using the slice object in numpy. But how can i select a submatrix A[i1,i2,i3;j1,j2,j3] (elements in A on line i1,i2,i3 and column j1,j2,j3 , and i1,i2,i3,j1,j2,j3 are all

Re: Extracting patterns after matching a regex

2009-09-09 Thread Al Fansome
Mart. wrote: On Sep 8, 4:33 pm, MRAB pyt...@mrabarnett.plus.com wrote: Mart. wrote: On Sep 8, 3:53 pm, MRAB pyt...@mrabarnett.plus.com wrote: Mart. wrote: On Sep 8, 3:14 pm, Andreas Tawn andreas.t...@ubisoft.com wrote: Hi, I need to extract a string after a matching a regular expression.

Re: a question about numpy

2009-09-09 Thread Robert Kern
On 2009-09-08 22:03 PM, sturlamolden wrote: On 9 Sep, 03:45, hi_rogerrechardc...@gmail.com wrote: i know how to select a submatrix using the slice object in numpy. But how can i select a submatrix A[i1,i2,i3;j1,j2,j3] (elements in A on line i1,i2,i3 and column j1,j2,j3 , and

python and openSSL

2009-09-09 Thread Luca Bel
Hi all. I need a trick to do something like this: openssl smime -decrypt -verify -inform DER -in ReadmeDiKe.pdf.p7m -noverify -out ReadmeDike.pdf To unwrap a p7m file and read his content. I know that I could use somthing like: import os os.system('openssl ') but i would use a python

Re: Rapid GUI Programming with Python and Qt source code

2009-09-09 Thread Mark
On Sep 9, 2:33 pm, David Boddie dbod...@trolltech.com wrote: On Wed Sep 9 07:11:26 CEST 2009, Steven Woody wrote: *I've searched google and cannot find a valid link for the source code of the book Rapid GUI Programming with Python and Qt. Could anyone please give me a non-broken URL?*

Function to apply superset of arguments to a function

2009-09-09 Thread Andrey Fedorov
Hi all, I've written a function [1] called apply_some which takes a set of keywords arguments, filters only those a function is expecting, and calls the function with only those arguments. This is meant to suppress TypeErrors - a way to abstract the logic which checks what arguments a passed-in

Re: Multiple inheritance - How to call method_x in InheritedBaseB from method_x in InheritedBaseA?

2009-09-09 Thread ryles
On Sep 9, 1:47 am, The Music Guy music...@alphaios.net wrote: I should also mention--and I should have realized this much sooner--that each of the BaseN classes are themselves each going to have at least one common base which will define method_x, so each BaseN will be calling that if it

Re: logging sound / speech handler?

2009-09-09 Thread Chris Hulan
On Sep 9, 11:03 am, Gregor Horvath g...@gregor-horvath.com wrote: Hi, For an application in an industrial environment where the workers are not always sitting in front of the monitor, but are within earshot of the PC I would need an sound / speech handler for the standard logging system. It

Re: Function to apply superset of arguments to a function

2009-09-09 Thread David Stanek
On Wed, Sep 9, 2009 at 12:45 PM, Andrey Fedorovanfedo...@gmail.com wrote: Hi all, I've written a function [1] called apply_some which takes a set of keywords arguments, filters only those a function is expecting, and calls the function with only those arguments. This is meant to suppress

Re: [Tkinter] messed callbacks

2009-09-09 Thread John Posner
snip def cb12(): return output(c1+'-'+c2) def cb21(): return output(c2+'-'+c1) I think these can be simplified, e.g: def cb12(): output(c1+'-'+c2) But I'd go with the functools.partial approach. You can save some code by making output() do more of the work:

HTTP POST File without cURL

2009-09-09 Thread John D Giotta
I'm working with an API that allows me to POST a zip file via HTTP and the documentation uses a cURL example. cURL works, but when I try to POST the file via python it fails. I don't want to use cURL (since I'm trying to be transparent and dependency-less), but I can't find anything online that

Re: hanning python

2009-09-09 Thread sturlamolden
On 9 Sep, 16:57, pdpi pdpinhe...@gmail.com wrote: Raising this to 1 million, rather than 100, nodes in the window, the timing difference between your version and NumPy's is tiny (but numpy still edges you out, but just barely), but they trounce my naive version, being around 7 or 8 times

Re: logging sound / speech handler?

2009-09-09 Thread Stef Mientki
Gregor Horvath wrote: Hi, For an application in an industrial environment where the workers are not always sitting in front of the monitor, but are within earshot of the PC I would need an sound / speech handler for the standard logging system. It should beep or better say the logging message.

Re: Function to apply superset of arguments to a function

2009-09-09 Thread Andrey Fedorov
When a web request is made, my Django views are called with argument `user_id' present if someone is logged in, and set to None if the request is anonymous. The response varies based on this argument - someone pulling a team's information will get their relationship to the team if they are logged

Re: Multiple inheritance - How to call method_x in InheritedBaseB from method_x in InheritedBaseA?

2009-09-09 Thread Carl Banks
On Sep 8, 10:47 pm, The Music Guy music...@alphaios.net wrote: I should also mention--and I should have realized this much sooner--that each of the BaseN classes are themselves each going to have at least one common base which will define method_x, so each BaseN will be calling that if it

Re: Class variable inheritance

2009-09-09 Thread Carl Banks
On Sep 9, 3:32 am, HPJ henrypija...@gmail.com wrote: Maybe.  For some languages this might be an obvious behavior, but Python would have different circumstances so it isn't so obvious (or possible) there. Which means this topic definitely needs to be handled in detail by the LR, and

Re: Function to apply superset of arguments to a function

2009-09-09 Thread 7stud
On Sep 9, 10:45 am, Andrey Fedorov anfedo...@gmail.com wrote: Hi all, I've written a function [1] called apply_some which takes a set of keywords arguments, filters only those a function is expecting, and calls the function with only those arguments. This is meant to suppress TypeErrors - a

Re: HTTP POST File without cURL

2009-09-09 Thread David Stanek
On Wed, Sep 9, 2009 at 1:57 PM, John D Giottajdgio...@gmail.com wrote: I'm working with an API that allows me to POST a zip file via HTTP and the documentation uses a cURL example. cURL works, but when I try to POST the file via python it fails. I don't want to use cURL (since I'm trying to be

Re: HTTP POST File without cURL

2009-09-09 Thread Jarkko Torppa
On 2009-09-09, John D Giotta jdgio...@gmail.com wrote: I'm working with an API that allows me to POST a zip file via HTTP and the documentation uses a cURL example. cURL works, but when I try to POST the file via python it fails. I don't want to use cURL (since I'm trying to be transparent and

Re: start default application for read a pdf from python

2009-09-09 Thread Angelo Ballabio
Thenks for this suggestion, at the end I find this solution import os . . #then where I decide to show the file in the default application I put this #file_name the name I construct with path and all necessary #recor contain all the data of one record end the 4th position

Re: PyPI upload documentation

2009-09-09 Thread Dan Yamins
Sorry to write again, but really nobody on the Python list knows how to get in touch with the people running PyPI's website in an effective way? Thanks! Dan On Tue, Sep 8, 2009 at 6:25 PM, Dan Yamins dyam...@gmail.com wrote: Dear all: I'm trying to upload documentation to the PyPI site for

Re: Q on explicitly calling file.close

2009-09-09 Thread David C Ullrich
On Sat, 05 Sep 2009 23:41:08 +, Steven D'Aprano wrote: On Sat, 05 Sep 2009 16:14:02 +, kj wrote: Finally, I was under the impression that Python closed filehandles automatically when they were garbage-collected. [...] (3) For quick and dirty scripts, or programs that only use one

Python server locks up

2009-09-09 Thread Zac Burns
I have a server running Python 2.6x64 which after running for about a month decides to lock up and become unresponsive to all threads for several minutes at a time. While it is locked up Python proceeds to consume large amounts of continually increasing memory. The basic function of the server is

Re: PyPI upload documentation

2009-09-09 Thread Robert Kern
On 2009-09-09 15:14 PM, Dan Yamins wrote: Sorry to write again, but really nobody on the Python list knows how to get in touch with the people running PyPI's website in an effective way? http://www.python.org/community/sigs/current/catalog-sig/ -- Robert Kern I have come to believe that the

Re: Python server locks up

2009-09-09 Thread MRAB
Zac Burns wrote: I have a server running Python 2.6x64 which after running for about a month decides to lock up and become unresponsive to all threads for several minutes at a time. While it is locked up Python proceeds to consume large amounts of continually increasing memory. The basic

Re: Q on explicitly calling file.close

2009-09-09 Thread r
On Sep 9, 3:18 pm, David C Ullrich dullr...@sprynet.com wrote: (snip) These days I've actually got the syntax and spelling memorized - I can type close() without needing to look it up! +1 You are so right David! I think some people around here need to look up code reuse. Here are a couple of

Re: Function to apply superset of arguments to a function

2009-09-09 Thread Mel
David Stanek wrote: On Wed, Sep 9, 2009 at 12:45 PM, Andrey Fedorovanfedo...@gmail.com wrote: I've written a function [1] called apply_some which takes a set of keywords arguments, filters only those a function is expecting, and calls the function with only those arguments. This is meant to

Re: Q on explicitly calling file.close

2009-09-09 Thread MRAB
r wrote: [snip] #-- Double Extra Creidit --# Create a backup_file() function that takes filename as arg and creates a copy of the file with the extension .bak... backup_file('C:\test.txt') - 'C:\test.bak' You should've used raw strings. :-) --

Re: Q on explicitly calling file.close

2009-09-09 Thread Charles Yeomans
On Sep 9, 2009, at 4:50 PM, r wrote: On Sep 9, 3:18 pm, David C Ullrich dullr...@sprynet.com wrote: (snip) These days I've actually got the syntax and spelling memorized - I can type close() without needing to look it up! +1 You are so right David! I think some people around here need to

Re: Function to apply superset of arguments to a function

2009-09-09 Thread David Stanek
On Wed, Sep 9, 2009 at 5:03 PM, Melmwil...@the-wire.com wrote: David Stanek wrote: On Wed, Sep 9, 2009 at 12:45 PM, Andrey Fedorovanfedo...@gmail.com wrote: I've written a function [1] called apply_some which takes a set of keywords arguments, filters only those a function is expecting, and

search term parsing like Google/Gmail

2009-09-09 Thread Randy Syring
I am looking for a string parser that works kind of like Google's or Gmail's advanced search capabilities. So it would turn something like this: (subject:hi there from:[tim, tom, -fred]) or (subject:foobar from:sam) into a python structure that could be used. I don't really care so much

Re: Function to apply superset of arguments to a function

2009-09-09 Thread Carl Banks
On Sep 9, 10:40 am, David Stanek dsta...@dstanek.com wrote: On Wed, Sep 9, 2009 at 12:45 PM, Andrey Fedorovanfedo...@gmail.com wrote: Hi all, I've written a function [1] called apply_some which takes a set of keywords arguments, filters only those a function is expecting, and calls the

Re: Function to apply superset of arguments to a function

2009-09-09 Thread Carl Banks
On Sep 9, 11:47 am, 7stud bbxx789_0...@yahoo.com wrote: On Sep 9, 10:45 am, Andrey Fedorov anfedo...@gmail.com wrote: Hi all, I've written a function [1] called apply_some which takes a set of keywords arguments, filters only those a function is expecting, and calls the function

Re: Function to apply superset of arguments to a function

2009-09-09 Thread Carl Banks
On Sep 9, 9:45 am, Andrey Fedorov anfedo...@gmail.com wrote: Hi all, I've written a function [1] called apply_some which takes a set of keywords arguments, filters only those a function is expecting, and calls the function with only those arguments. This is meant to suppress TypeErrors - a

Re: Q on explicitly calling file.close

2009-09-09 Thread r
On Sep 9, 4:19 pm, Charles Yeomans char...@declaresub.com wrote: (snip:) Unfortunately, both of these simple templates have the following   problem -- if open fails, a NameError will be raised from the finally   block. (snip) I removed the except block because I prefer exceptions to error

how to log connection refused attempt with python-paramiko

2009-09-09 Thread nickname
hello all, I am getting to grips with paramiko. I am trying to open a ssh connection to my server 127.0.0.1 using paramiko and want to specify the password via the program itself. I want to generate and change passwds via the program very frequently and hence am avoiding a key based

Re: how to log connection refused attempt with python-paramiko

2009-09-09 Thread nickname
On Sep 9, 3:35 pm, nickname thebiggestbangthe...@gmail.com wrote: hello all,             I am getting to grips with paramiko. I am trying to open a ssh connection to my server 127.0.0.1 using paramiko and want to specify the password via the program itself. I want to generate  and change

Re: how to log connection refused attempt with python-paramiko

2009-09-09 Thread nickname
On Sep 9, 3:37 pm, nickname thebiggestbangthe...@gmail.com wrote: On Sep 9, 3:35 pm, nickname thebiggestbangthe...@gmail.com wrote: hello all,             I am getting to grips with paramiko. I am trying to open a ssh connection to my server 127.0.0.1 using paramiko and want to specify

Re: logging sound / speech handler?

2009-09-09 Thread Tim Chase
For an application in an industrial environment where the workers are not always sitting in front of the monitor, but are within earshot of the PC I would need an sound / speech handler for the standard logging system. It should beep or better say the logging message. (with standard filtering

Re: PyPI upload documentation

2009-09-09 Thread Dan Yamins
On Wed, Sep 9, 2009 at 4:29 PM, Robert Kern robert.k...@gmail.com wrote: On 2009-09-09 15:14 PM, Dan Yamins wrote: Sorry to write again, but really nobody on the Python list knows how to get in touch with the people running PyPI's website in an effective way?

lxml question

2009-09-09 Thread mattia
I would like to click on an image in a web page that I retrieve using urllib in order to trigger an event. Here is the piece of code with the image that I want to click: input type=image style=border-width: 0px; height: 22px; width: 49px; onclick=return checkPhoneField(document.contactFrm,

Re: PyPI upload documentation

2009-09-09 Thread Robert Kern
On 2009-09-09 18:14 PM, Dan Yamins wrote: On Wed, Sep 9, 2009 at 4:29 PM, Robert Kern robert.k...@gmail.com mailto:robert.k...@gmail.com wrote: On 2009-09-09 15:14 PM, Dan Yamins wrote: Sorry to write again, but really nobody on the Python list knows how to get in

Re: Multiple inheritance - How to call method_x in InheritedBaseB from method_x in InheritedBaseA?

2009-09-09 Thread The Music Guy
On Wed, Sep 9, 2009 at 1:21 PM, Carl Bankspavlovevide...@gmail.com wrote: On Sep 8, 10:47 pm, The Music Guy music...@alphaios.net wrote: What is get_other_base?  Just use a regular super call here, get_other_base and hacks like that are what gets you into trouble. You seem to be overthinking

Re: Multiple inheritance - How to call method_x in InheritedBaseB from method_x in InheritedBaseA?

2009-09-09 Thread The Music Guy
Btw, Carl, please forgive me if I frustrate you, because I'm trying my best not to. I'm trying to keep track of what I did and what you did and what Ryles and Scott did, while at the same time trying to keep a firm grasp of exactly what it is I'm trying to acheive. Besides that, I'm not a

Re: search term parsing like Google/Gmail

2009-09-09 Thread Daniel Fetchinson
I am looking for a string parser that works kind of like Google's or Gmail's advanced search capabilities. So it would turn something like this: (subject:hi there from:[tim, tom, -fred]) or (subject:foobar from:sam) into a python structure that could be used. I don't really care so

ANN: dh, the daemon helper

2009-09-09 Thread John Kelly
dh, the daemon helper The daemon helper starts any program or script as a daemon. It's a small C program with a simple interface and a liberal license. ftp://ftp.isp2dial.com/users/jak/src/dh/ Get the files and do: make install clean To build and install dh. Don't try to run the

Re: lxml question

2009-09-09 Thread Chris Rebert
On Wed, Sep 9, 2009 at 4:11 PM, mattiager...@gmail.com wrote: I would like to click on an image in a web page that I retrieve using urllib in order to trigger an event. Here is the piece of code with the image that I want to click: input type=image style=border-width: 0px; height: 22px; width:

Re: Multiple inheritance - How to call method_x in InheritedBaseB from method_x in InheritedBaseA?

2009-09-09 Thread Carl Banks
On Sep 9, 4:37 pm, The Music Guy music...@alphaios.net wrote: On Wed, Sep 9, 2009 at 1:21 PM, Carl Bankspavlovevide...@gmail.com wrote: On Sep 8, 10:47 pm, The Music Guy music...@alphaios.net wrote: What is get_other_base?  Just use a regular super call here, get_other_base and hacks like

Re: Python server locks up

2009-09-09 Thread Zac Burns
If it has been running continuously all that time then it might be that the dictionary has grown too big (is that possible?) or that it's a memory fragmentation problem. In the latter case it might be an idea to restart Python every so often; perhaps it could do that automatically during a

Re: Less APIs or more encapsulation?

2009-09-09 Thread Tycho Andersen
On Wed, Sep 9, 2009 at 10:08 AM, 一首诗newpt...@gmail.com wrote: But when C has many many methods to expose to outer user, 2nd choice seems to be more reasonable I In the first design, B.newMethod did nothing really useful. Is there any reason you can't do something like the following? class

Re: a question about numpy

2009-09-09 Thread rechard
Robert Kern wrote: On 2009-09-08 20:45 PM, hi_roger wrote: hello, i want to ask a question about numpy. i know how to select a submatrix using the slice object in numpy. But how can i select a submatrix A[i1,i2,i3;j1,j2,j3] (elements in A on line i1,i2,i3 and column j1,j2,j3 , and

Re: Python server locks up

2009-09-09 Thread David Stanek
On Wed, Sep 9, 2009 at 4:28 PM, Zac Burnszac...@gmail.com wrote: How would you suggest to figure out what is the problem? I don't think you said your OS so I'll assume Linux. Sometimes it is more noise than value, but stracing the process may shed light on what system calls are being made.

Re: python and openSSL

2009-09-09 Thread exarkun
On 9 Sep, 01:30 pm, luca...@gmail.com wrote: Hi all. I need a trick to do something like this: openssl smime -decrypt -verify -inform DER -in ReadmeDiKe.pdf.p7m -noverify -out ReadmeDike.pdf To unwrap a p7m file and read his content. I know that I could use somthing like: import os

  1   2   >