__str__ for large objects, would not c++ iostream be more efficient

2006-08-28 Thread alf
Hi, is there any way in Python to have iostream like __str__ operator? -- alf -- http://mail.python.org/mailman/listinfo/python-list

Re: M$ windows python libs installed in arbitrary directories forcustomized python distributions

2006-08-28 Thread alf
Martin v. Löwis wrote: >>it's spelled "Windows installers" > I want to second this. It was me who created the installer, and I don't > like to see my name abbreviated as M$ (if you think you should write > out the name of the MSI creator, please say "Martin's installer" :-). ok, let me clarify, b

Re: M$ windows python libs installed in arbitrary directories forcustomized python distributions

2006-08-28 Thread Steve Holden
alf wrote: > Martin v. Löwis wrote: > >>>it's spelled "Windows installers" >> >>I want to second this. It was me who created the installer, and I don't >>like to see my name abbreviated as M$ (if you think you should write >>out the name of the MSI creator, please say "Martin's installer" :-). >

Re: Desktop Notification/Alerts In Python

2006-08-28 Thread zutesmog
Chaos wrote: > I am looking for ways to have a Desktop Alert, like the one most IM > Messengers have (MSN, AIM) at the lower right above the taskbar. Can > anyone point me to the right resources to use? I am not sure exactly what you are looking for but I assume you are using windows, so I would

Re: eval() woes

2006-08-28 Thread rdrink
Ok, maybe now I can make some more sense of this, with an example of real code (sorry if it's a bit dense): This is the basic function... def equate(parts,new_eq): oL = int(parts[0]) iL = int(parts[1]) iR = int(parts[2]) oR = int(parts[3]) oLoL = int(str(o

Re: Pros/Cons of Turbogears/Rails?

2006-08-28 Thread Steve Holden
Ray wrote: > Paul Boddie wrote: > >>>But at least in most developers' perception, it is (not necessarily in >>>the absolute sense, but perhaps relative to Django or Turbogears). >>>Mind, it doesn't even need to be true, we're talking of perception >>>here. >> >>So actual maturity isn't important w

Re: __str__ for large objects, would not c++ iostream be more efficient

2006-08-28 Thread Gabriel Genellina
At Tuesday 29/8/2006 00:04, alf wrote: is there any way in Python to have iostream like __str__ operator? Define a method writeTo(f) if you want, and instead of: f.write('%s' % obj) use: obj.writeTo(f) Gabriel Genellina Softlab SRL _

Re: how to varify if a URL is valid in python?

2006-08-28 Thread Steve Holden
fegge wrote: > what module should i import? > You probably want urllib. If you have the Tools directory in your Python distro you can take a look at the webchecker.py application for an example of how it might be done. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Hol

Re: How to let a loop run for a while before checking for break condition?

2006-08-28 Thread Steve Holden
Claudio Grondi wrote: > Sorin Schwimmer wrote: [...] > It doesn't. > > Claudio Sometimes silence is preferable to a concrete response. It takes less time and occupies less bandwidth. regards Steve who should perhaps have followed his own advice -- Steve Holden +44 150 684 7255 +1 8

Re: Is this a good idea or a waste of time?

2006-08-28 Thread Antoon Pardon
On 2006-08-28, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Antoon Pardon wrote: >> There seem to be enough problems that work with ints but not with >> floats. In such a case enforcing that the number you work with >> is indeed an int seems fully appropiate. > > I've _never_ seen a case where en

Re: eval() woes

2006-08-28 Thread John McMonagle
On Mon, 2006-08-28 at 21:13 -0700, rdrink wrote: > > (BTW, as a footnote: For each of the above 'equations' the function > equate() was called 500 times... in some cases with the list 'parts' > equaling things like ['0',2','3','0'], so I have no reason to believe > that the problem is with the wa

Re: eval() woes

2006-08-28 Thread Gabriel Genellina
At Tuesday 29/8/2006 01:13, rdrink wrote: File "the_farmer2.py", line 112, in equate iL = int(parts[1]) ValueError: invalid literal for int(): - So parts[1] is '-'. Try adding a few print statements; I'd add a try/except around those lines, printing parts, I bet it's not what you expect

Re: eval() woes

2006-08-28 Thread Simon Forman
rdrink wrote: > Hey Simon, Thanks for the reply. > > Simon Forman wrote: > > You must be doing something weird, that equation works for me: > > Try posting the minimal code example that causes the error and the > > full, exact traceback that you get. > > I appreciate the offer... but at this point

Re: Is this a good idea or a waste of time?

2006-08-28 Thread Gabriel Genellina
At Tuesday 29/8/2006 01:28, Antoon Pardon wrote: > Antoon Pardon wrote: >> There seem to be enough problems that work with ints but not with >> floats. In such a case enforcing that the number you work with >> is indeed an int seems fully appropiate. > > I've _never_ seen a case where enforcing

Re: eval() woes

2006-08-28 Thread Simon Forman
rdrink wrote: > Ok, maybe now I can make some more sense of this, with an example of > real code (sorry if it's a bit dense): > This is the basic function... > > def equate(parts,new_eq): > > oL = int(parts[0]) > iL = int(parts[1]) > iR = int(parts[2]) > oR = int(parts[3]) >

Re: Is this a good idea or a waste of time?

2006-08-28 Thread Simon Forman
Antoon Pardon wrote: > On 2006-08-28, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Antoon Pardon wrote: > >> There seem to be enough problems that work with ints but not with > >> floats. In such a case enforcing that the number you work with > >> is indeed an int seems fully appropiate. > > >

Re: Is this a good idea or a waste of time?

2006-08-28 Thread Antoon Pardon
On 2006-08-29, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > At Tuesday 29/8/2006 01:28, Antoon Pardon wrote: > >> > Antoon Pardon wrote: >> >> There seem to be enough problems that work with ints but not with >> >> floats. In such a case enforcing that the number you work with >> >> is indeed an

RE: Operator Overloading Basics

2006-08-28 Thread Mohit Bhatt
Thanks a lot Fredrik and Tim for your help. Cheers, Mohit -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this a good idea or a waste of time?

2006-08-28 Thread Gabriel Genellina
At Tuesday 29/8/2006 02:45, Antoon Pardon wrote: >>That may be true. But one may wonder if this is a failing of the >>programmer or a failing of the language that doesn't support >>such things. > > In any case, I don't see how this supports the original claim that > strict type checking input pa

Re: unit test for a printing method

2006-08-28 Thread Marco Wahl
> [OP] What is the proper way to test (using unit test) a method that print > information? > [...] Fredrik Lundh <[EMAIL PROTECTED]> writes: > > Scott David Daniels wrote: > >> For silly module myprog.py: >> def A(s): >> print '---'+s+'---' >> in test_myprog.py: >> import unitte

Re: [ANN] NumPy 1.0b4 now available

2006-08-28 Thread Bruce Who
Hi, Travis I can pack my scripts into an executable with py2exe, but errors occur once it runs: No scipy-style subpackage 'random' found in D:\test\dist\numpy. Ignoring: No module named info import core -> failed: No module named _internal import lib -> failed: 'module' object has no attribute '_

Re: Is this a good idea or a waste of time?

2006-08-28 Thread Antoon Pardon
On 2006-08-29, Simon Forman <[EMAIL PROTECTED]> wrote: > Antoon Pardon wrote: >> On 2006-08-28, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> > Antoon Pardon wrote: >> >> There seem to be enough problems that work with ints but not with >> >> floats. In such a case enforcing that the number you w

Re: Is this a good idea or a waste of time?

2006-08-28 Thread Antoon Pardon
On 2006-08-29, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > At Tuesday 29/8/2006 02:45, Antoon Pardon wrote: > >> >>That may be true. But one may wonder if this is a failing of the >> >>programmer or a failing of the language that doesn't support >> >>such things. >> > >> > In any case, I don't s

<    1   2   3