Re: Are routine objects guaranteed mutable & with dictionary?

2009-12-06 Thread Alf P. Steinbach
* MRAB: Alf P. Steinbach wrote: > * Dennis Lee Bieber: >> On Sat, 05 Dec 2009 11:26:34 +0100, "Alf P. Steinbach" >> declaimed the following in >> gmane.comp.python.general: >> >>> The devolution of terminology has been so severe that now even the >>> Wikipedia article on this subject conf

Re: how to convert string function to string method?

2009-12-06 Thread Stephen Hansen
On Sun, Dec 6, 2009 at 10:47 PM, Dr. Phillip M. Feldman < pfeld...@verizon.net> wrote: > > I wrote a handy-dandy function (see below) called "strip_pairs" for > stripping > matching pairs of characters from the beginning and end of a string. This > function works, but I would like to be able to i

how to convert string function to string method?

2009-12-06 Thread Dr. Phillip M. Feldman
I wrote a handy-dandy function (see below) called "strip_pairs" for stripping matching pairs of characters from the beginning and end of a string. This function works, but I would like to be able to invoke it as a string method rather than as a function. Is this possible? def strip_pairs(s=None

Re: What is the significance of after() in this code?

2009-12-06 Thread alex23
zeph wrote: > True, though by *context* the after method looks like it takes a time > (probably in milliseconds, given its size), and a method, and calls > the method after that amount of time, and returning some process/ > thread id to self.after_id.  Though if that's right, we still don't > know

Re: What is the significance of after() in this code?

2009-12-06 Thread zeph
On Dec 6, 8:46 pm, Benjamin Kaplan wrote: > On Sun, Dec 6, 2009 at 10:29 PM, W. eWatson wrote: > > See Subject. > >    def StackImages(self): > >        self.Upload("P") > >        self.after_id = self.master.after(1,self.GetFrameOne) > > -- > >http://mail.python.org/mailman/listinfo/python-l

Re: Are routine objects guaranteed mutable & with dictionary?

2009-12-06 Thread MRAB
Alf P. Steinbach wrote: > * Dennis Lee Bieber: >> On Sat, 05 Dec 2009 11:26:34 +0100, "Alf P. Steinbach" >> declaimed the following in >> gmane.comp.python.general: >> >>> The devolution of terminology has been so severe that now even the >>> Wikipedia article on this subject confounds the genera

Re: Float precision and float equality

2009-12-06 Thread dbd
On Dec 6, 1:48 pm, sturlamolden wrote: > On 6 Des, 21:52, r0g wrote: > > > > .> Right.  Using abs(x-y) < eps is the way to go. > > > .> > > > .> Raymond > > > > This only works when abs(x) and abs(y) are larger that eps, but not > > > too much larger. > > > Okay, I'm confused now... I thought the

Re: Generators.

2009-12-06 Thread Lie Ryan
On 12/7/2009 7:22 AM, Jorge Cardona wrote: Hi, I was trying to create a function that receive a generator and return a list but that each elements were computed in a diferent core of my machine. I start using islice function in order to split the job in a way that if there is "n" cores each "i"

python proxy checker ,change to threaded version

2009-12-06 Thread elca
Hello ALL, i have some python proxy checker . and to speed up check, i was decided change to mutlthreaded version, and thread module is first for me, i was tried several times to convert to thread version and look for many info, but it not so much easy for novice python programmar . if anyon

Re: What is the significance of after() in this code?

2009-12-06 Thread Benjamin Kaplan
On Sun, Dec 6, 2009 at 10:29 PM, W. eWatson wrote: > See Subject. >    def StackImages(self): >        self.Upload("P") >        self.after_id = self.master.after(1,self.GetFrameOne) > -- > http://mail.python.org/mailman/listinfo/python-list > I think this is close to winning an award for "le

Re: What is the significance of after() in this code?

2009-12-06 Thread Carl Banks
On Dec 6, 7:29 pm, "W. eWatson" wrote: > See Subject. >      def StackImages(self): >          self.Upload("P") >          self.after_id = self.master.after(1,self.GetFrameOne) It's a "method" of the object that is bound to "self.master". It's return value is then bound to the attribute "aft

What is the significance of after() in this code?

2009-12-06 Thread W. eWatson
See Subject. def StackImages(self): self.Upload("P") self.after_id = self.master.after(1,self.GetFrameOne) -- http://mail.python.org/mailman/listinfo/python-list

Re: Float precision and float equality

2009-12-06 Thread Dave Angel
Carl Banks wrote: On Dec 6, 11:34 am, Anton81 wrote: I do some linear algebra and whenever the prefactor of a vector turns out to be zero, I want to remove it. I'd like to keep the system comfortable. So basically I should write a new class for numbers that has it's own __eq__ operator? I

Re: How to create a docstring for a module?

2009-12-06 Thread alex23
"Phillip M. Feldman" wrote: > It does seem as though IPython could be a bit more clever about this.   I disagree. I _like_ that IPython is only reporting on the current state of the interpreter and not trying to second guess what I meant. > If the user asks for documentation on xyz via "?xyz" an

Re: High-performance Python websites

2009-12-06 Thread Aaron Watters
The key to scaling a web site is to make sure you can load-balance to as many front ends as needed and then use a common database backend that is fast enough or possibly a common file system that is fast enough. I can't speak to Django specifically but you can certainly get essentially unlimited s

Re: Are routine objects guaranteed mutable & with dictionary?

2009-12-06 Thread Alf P. Steinbach
* Dennis Lee Bieber: On Sat, 05 Dec 2009 11:26:34 +0100, "Alf P. Steinbach" declaimed the following in gmane.comp.python.general: The devolution of terminology has been so severe that now even the Wikipedia article on this subject confounds the general concept of "routine" with the far more s

Re: How to create a docstring for a module?

2009-12-06 Thread Phillip M. Feldman
Chris Rebert wrote: On Sun, Dec 6, 2009 at 12:34 PM, Dr. Phillip M. Feldman wrote: OK. I was able to reproduce the problem. My difficulty was that the command that I issued initially was "from xyz import *" rather than just "import xyz". If I say "import xyz", then the docstring is define

Re: Float precision and float equality

2009-12-06 Thread David Cournapeau
On Sun, Dec 6, 2009 at 1:46 AM, Mark Dickinson wrote: > On Dec 5, 3:37 pm, Anton81 wrote: >> I'd like to do calculations with floats and at some point equality of >> two number will be checked. >> What is the best way to make sure that equality of floats will be >> detected, where I assume that m

Re: Float precision and float equality

2009-12-06 Thread TheSeeker
On Dec 6, 4:54 pm, Carl Banks wrote: > On Dec 6, 11:34 am, Anton81 wrote: > > > I do some linear algebra and whenever the prefactor of a vector turns > > out to be zero, I want to remove it. > > > I'd like to keep the system comfortable. So basically I should write a > > new class for numbers tha

Re: Float precision and float equality

2009-12-06 Thread Carl Banks
On Dec 6, 11:34 am, Anton81 wrote: > I do some linear algebra and whenever the prefactor of a vector turns > out to be zero, I want to remove it. > > I'd like to keep the system comfortable. So basically I should write a > new class for numbers that has it's own __eq__ operator? > Is there an exis

Re: When will Python 3 be fully deployed

2009-12-06 Thread Martin P. Hellwig
Edward A. Falk wrote: For development purposes, you should stick with the oldest version that will actually run your code. Every time you move to a more modern version, you're leaving potential users/customers out in the cold. If the fear of customers disatification prevents you from using a

Re: When will Python 3 be fully deployed

2009-12-06 Thread Colin W.
On 06-Dec-09 13:25 PM, Luis M. González wrote: On Dec 6, 3:21 pm, vsoler wrote: I recently read that many libraries, including Numpy have not been ported to Python 3. When do you think that Python 3 will be fully deployed? Should I stick, so far, to Python 2.6? Regards Vicente Soler You'l

CMNDBOT 0.1 BETA2 released

2009-12-06 Thread Bart Thate
Hello world ! a week after BETA1 i'm releasing BETA2, changes go fast ;] what changed in this version: * RSS plugin can now push to xmpp clients .. add cmnd...@appspot.com to your jabber client and do 1) rss-add to add a feed 2) use rss-start to make the bot start sending you feed updates. * a

hola

2009-12-06 Thread franki fuentes cueto
hola soy un pequeño programador y quiesiera pedirles ayuda para programar en python, no se si me podrian mandar ejemplos para poder empezar, y como terminarlo para que se ejecute, me entiendes , aver sime ayudan gracias -- ..FrankiSoft... -- http://mail.python.org/mailman/listinfo/python

Re: Float precision and float equality

2009-12-06 Thread Dave Angel
Anton81 wrote: I do some linear algebra and whenever the prefactor of a vector turns out to be zero, I want to remove it. I'd like to keep the system comfortable. So basically I should write a new class for numbers that has it's own __eq__ operator? Is there an existing module for that? Y

Re: When will Python 3 be fully deployed

2009-12-06 Thread Edward A. Falk
In article , vsoler wrote: >I recently read that many libraries, including Numpy have not been >ported to Python 3. > >When do you think that Python 3 will be fully deployed? It will never be fully deployed. There will always be people out there who haven't felt it necessary to upgrade their sy

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-06 Thread Dave Angel
Hans Mulder wrote: J wrote: But that being said, this brings to mind a question about this... in *nix, when I can't do something like delete a file or directory, or unmount a filesystem and cant find the cause, I can do an lsof and grep for references to the file/directory in question, then wo

Re: Float precision and float equality

2009-12-06 Thread sturlamolden
On 6 Des, 21:52, r0g wrote: > > .> Right.  Using abs(x-y) < eps is the way to go. > > .> > > .> Raymond > > > This only works when abs(x) and abs(y) are larger that eps, but not > > too much larger. > > Okay, I'm confused now... I thought them being larger was entirely the > point. Yes. dbd got

Re: How to create a docstring for a module?

2009-12-06 Thread Stefan Behnel
Dr. Phillip M. Feldman, 06.12.2009 21:34: > OK. I was able to reproduce the problem. My difficulty was that the command > that I issued initially was "from xyz import *" rather than just "import > xyz". If I say "import xyz", then the docstring is defined; if I say "from > xyz import *", it isn'

Re: How to create a docstring for a module?

2009-12-06 Thread Chris Rebert
On Sun, Dec 6, 2009 at 12:34 PM, Dr. Phillip M. Feldman wrote: > OK.  I was able to reproduce the problem.  My difficulty was that the command > that I issued initially was "from xyz import *" rather than just "import > xyz".  If I say "import xyz", then the docstring is defined; if I say "from >

Re: Python3: Sane way to deal with broken encodings

2009-12-06 Thread Bruno Desthuilliers
Johannes Bauer a écrit : > Dear all, > > I've some applciations which fetch HTML docuemnts off the web, parse > their content and do stuff with it. Every once in a while it happens > that the web site administrators put up files which are encoded in a > wrong manner. > > Thus my Python script die

Re: Float precision and float equality

2009-12-06 Thread r0g
dbd wrote: > On Dec 6, 1:12 am, Raymond Hettinger wrote: >> On Dec 5, 11:42 pm, Tim Roberts wrote: >> >>> Raymond Hettinger wrote: if not round(x - y, 6): ... >>> That's a dangerous suggestion. It only works if x and y happen to be >>> roughly in the range of integers. > .> > .> Right.

Re: How to create a docstring for a module?

2009-12-06 Thread Dr. Phillip M. Feldman
OK. I was able to reproduce the problem. My difficulty was that the command that I issued initially was "from xyz import *" rather than just "import xyz". If I say "import xyz", then the docstring is defined; if I say "from xyz import *", it isn't. I'm not sure whether this is a bug or expecte

Re: How to create a docstring for a module?

2009-12-06 Thread Dr. Phillip M. Feldman
Steven D'Aprano-7 wrote: > > On Sun, 06 Dec 2009 10:55:50 +0100, Andreas Waldenburger wrote: > >> On Sat, 5 Dec 2009 23:04:42 -0800 (PST) "Dr. Phillip M. Feldman" >> wrote: >> >> >>> If I create a module xyz.py with a docstring """xyz does everything you >>> could possibly want.""" at the t

Python3: Sane way to deal with broken encodings

2009-12-06 Thread Johannes Bauer
Dear all, I've some applciations which fetch HTML docuemnts off the web, parse their content and do stuff with it. Every once in a while it happens that the web site administrators put up files which are encoded in a wrong manner. Thus my Python script dies a horrible death: File "./update_db"

Generators.

2009-12-06 Thread Jorge Cardona
Hi, I was trying to create a function that receive a generator and return a list but that each elements were computed in a diferent core of my machine. I start using islice function in order to split the job in a way that if there is "n" cores each "i" core will compute the elements i,i+n,i+2n,...

Re: Float precision and float equality

2009-12-06 Thread Anton81
I do some linear algebra and whenever the prefactor of a vector turns out to be zero, I want to remove it. I'd like to keep the system comfortable. So basically I should write a new class for numbers that has it's own __eq__ operator? Is there an existing module for that? -- http://mail.python.o

Re: Float precision and float equality

2009-12-06 Thread dbd
On Dec 6, 1:12 am, Raymond Hettinger wrote: > On Dec 5, 11:42 pm, Tim Roberts wrote: > > > Raymond Hettinger wrote: > > > >   if not round(x - y, 6): ... > > > That's a dangerous suggestion.  It only works if x and y happen to be > > roughly in the range of integers. .> .> Right.  Using abs(x-y)

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-06 Thread Hans Mulder
J wrote: But that being said, this brings to mind a question about this... in *nix, when I can't do something like delete a file or directory, or unmount a filesystem and cant find the cause, I can do an lsof and grep for references to the file/directory in question, then work from there to clo

Re: How to create a docstring for a module?

2009-12-06 Thread Paul McGuire
On Dec 6, 7:43 am, Steven D'Aprano wrote: > On Sun, 06 Dec 2009 06:34:17 -0600, Tim Chase wrote: > > I've occasionally wanted something like this, and have found that it can > > be done by manually assigning to __doc__ (either at the module-level or > > classes) which can make some documentation b

Re: NumPy installation won't import correctly

2009-12-06 Thread Alex
On Dec 1, 7:04 pm, Ethos wrote: > On Dec 1, 6:37 pm, David Cournapeau wrote: > > > On Wed, Dec 2, 2009 at 11:03 AM, Ethos wrote: > > > > I reinstallednumpy, from sourceforge, even though I had already > > > installed the latest version. Same business. 2.5 imports fine, 2.6 > > > doesn't. > > > >

wxEasyGUI: Easy and Interactive GUI Function Dialogs for Python newbie

2009-12-06 Thread Valter.Foresto
Python newbie, like me, need a simple, easy to understand and use, simple interactive GUI functions abd dialogs for starting using the language quickly. I wrote the wxEasyGUI simple library with this idea in my mind and started a new project on the SourceForge.net << wxEasyGUI - Easy to Use Interac

Re: When will Python 3 be fully deployed

2009-12-06 Thread Luis M . González
On Dec 6, 3:21 pm, vsoler wrote: > I recently read that many libraries, including Numpy have not been > ported to Python 3. > > When do you think that Python 3 will be fully deployed? > > Should I stick, so far, to Python 2.6? > > Regards > > Vicente Soler You'll have some answers here: http://j

Re: logging module, SMTPHandler and gmail in python 2.6

2009-12-06 Thread Vinay Sajip
On Dec 4, 12:31 pm, mynthon wrote: Thank you for this suggestion. Ideally, you would have created an issue for this on bugs.python.org, because then it would be more likely to be acted upon. I've implemented this feature in r76691 (in Python trunk and py3k) in a more general way. It works by spe

Re: How to create a docstring for a module?

2009-12-06 Thread Steven D'Aprano
On Sun, 06 Dec 2009 06:34:17 -0600, Tim Chase wrote: >> * He hasn't actually defined a docstring. Docstrings have to be string >> literals, you can't do this: >> >> """%s does everything you could possibly want.""" % "xyz" > > I've occasionally wanted something like this, and have found that it

Re: How to create a docstring for a module?

2009-12-06 Thread Tim Chase
* He hasn't actually defined a docstring. Docstrings have to be string literals, you can't do this: """%s does everything you could possibly want.""" % "xyz" I've occasionally wanted something like this, and have found that it can be done by manually assigning to __doc__ (either at the modul

Exception classes don't follow pickle protocol, problems unpickling

2009-12-06 Thread Irmen de Jong
Hi, I am puzzled why Python's exception classes don't seem to follow the pickle protocol. To be more specific: an instance of a user defined exception, subclassed from Exception, cannot be pickled/unpickled correctly in the expected way. The pickle protocol says that: __getinitargs__ is used

Re: How to create a docstring for a module?

2009-12-06 Thread Steven D'Aprano
On Sun, 06 Dec 2009 10:55:50 +0100, Andreas Waldenburger wrote: > On Sat, 5 Dec 2009 23:04:42 -0800 (PST) "Dr. Phillip M. Feldman" > wrote: > > >> If I create a module xyz.py with a docstring """xyz does everything you >> could possibly want.""" at the top, the command ?xyz issued at the >> IPy

Re: Can't print Chinese to HTTP

2009-12-06 Thread Dave Angel
Gnarlodious wrote: On Dec 5, 3:54 am, Lie Ryan wrote: Because of the switch to unicode str, a simple print('晉') should've worked flawlessly if your terminal can accept the character, but the problem is your terminal does not. There is nothing wrong with Terminal, Mac OSX supports Unic

Re: How to create a docstring for a module?

2009-12-06 Thread Andreas Waldenburger
On Sat, 5 Dec 2009 23:04:42 -0800 (PST) "Dr. Phillip M. Feldman" wrote: > > If I create a module xyz.py with a docstring """xyz does everything > you could possibly want.""" at the top, the command ?xyz issued at > the IPython prompt does not display this docstring. What am I doing > wrong? St

Re: Float precision and float equality

2009-12-06 Thread Raymond Hettinger
On Dec 5, 11:42 pm, Tim Roberts wrote: > Raymond Hettinger wrote: > > >   if not round(x - y, 6): ... > > That's a dangerous suggestion.  It only works if x and y happen to be > roughly in the range of integers. Right. Using abs(x-y) < eps is the way to go. Raymond -- http://mail.python.org/