Re: unittest inconsistent

2010-01-05 Thread André
On Jan 5, 8:14 pm, Matt Haggard wrote: > Can anyone tell me why this test fails? > > http://pastebin.com/f20039b17 > > This is a minimal example of a much more complex thing I'm trying to > do.  I'm trying to hijack a function and inspect the args passed to it > by another function. > > The reason

Re: parsing an Excel formula with the re module

2010-01-05 Thread Steve Holden
Tim Chase wrote: > vsoler wrote: >> Hence, I need to parse Excel formulas. Can I do it by means only of re >> (regular expressions)? >> >> I know that for simple formulas such as "=3*A7+5" it is indeed >> possible. What about complex for formulas that include functions, >> sheet names and possibly

Re: Fwd: I would like to install Python on my 64 bit Win 7

2010-01-05 Thread Sridhar Ratnakumar
On 1/5/2010 11:31 AM, aung paing Soe wrote: Hello , I would like to study about Python Programming . So I want to install Python . But my laptop is Window 7 64-bit home basic . So please give me a advice how to install Python in my 64 bit computer. I really want to study python progr

Re: please help shrink this each_with_index() implementation

2010-01-05 Thread Antoine Pitrou
> The point: int('') or int('something') both throw an error. In general, > this is hand-holding, but in specific I don't think the "rich and > structured" documentation will cover how to beat a 0 out of it in less > than 3 lines. Because it's a bad idea to do so and Python doesn't encourage such

Re: Minor bug in multiprocessing?

2010-01-05 Thread Aahz
[p&e] In article , Frank Millman wrote: > >Is this worth reporting, if it has not been reported already? Defiitely report it. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ Weinberg's Second Law: If builders built buildings the way programmers wrote programs,

Re: Exception as the primary error handling mechanism?

2010-01-05 Thread Chris Rebert
On Tue, Jan 5, 2010 at 5:45 PM, Phlip wrote: > On Jan 5, 5:01 pm, Chris Rebert wrote: >> > Why can't int('nonnumeric') return None? >> >> Errors should never pass silently. > > You are saying I, as the programmer, cannot decide what is an error > and what is a pass-thru. The decision is made for

Re: it gets worse (was: How do you configure IDLE on a Mac...)

2010-01-05 Thread Mensanator
On Jan 5, 4:03 pm, Ned Deily wrote: > In article > <6672dad2-26ba-458b-8075-21bac6506...@e37g2000yqn.googlegroups.com>, Mensanator > wrote: > > [...] > > > > > > > So, for all practical purposes, the macports install is broken also. > > > IDLE simply does not work in an X11 window (you think som

Re: please help shrink this each_with_index() implementation

2010-01-05 Thread MRAB
Antoine Pitrou wrote: The point: int('') or int('something') both throw an error. In general, this is hand-holding, but in specific I don't think the "rich and structured" documentation will cover how to beat a 0 out of it in less than 3 lines. Because it's a bad idea to do so and Python doesn'

Re: please help shrink this each_with_index() implementation

2010-01-05 Thread alex23
Phlip wrote: > They will tell me how to use except: (which is a good example why a > program should not use exceptions for its normal control flow if at > all possible). Really? Magic functions that coerce and eat errors are a better coding technique than exceptions and explicit handling? What k

Do I have to use threads?

2010-01-05 Thread aditya shukla
Hello people, I have 5 directories corresponding 5 different urls .I want to download images from those urls and place them in the respective directories.I have to extract the contents and download them simultaneously.I can extract the contents and do then one by one. My questions is for doing it

Re: Do I have to use threads?

2010-01-05 Thread Philip Semanchuk
On Jan 5, 2010, at 11:26 PM, aditya shukla wrote: Hello people, I have 5 directories corresponding 5 different urls .I want to download images from those urls and place them in the respective directories.I have to extract the contents and download them simultaneously.I can extract the c

Re: Exception as the primary error handling mechanism?

2010-01-05 Thread Steven D'Aprano
On Wed, 06 Jan 2010 00:58:58 +, r0g wrote: > Steven D'Aprano wrote: >> On Wed, 06 Jan 2010 09:39:08 +1100, Ben Finney wrote: >> >>> r0g writes: >>> Of course I'm now guilty of pedantry too :/ I might have let it slip had you not started your reply with the word "No", that just p***

Re: Exception as the primary error handling mechanism?

2010-01-05 Thread Steven D'Aprano
On Tue, 05 Jan 2010 15:51:29 -0800, Phlip wrote: > Why can't int('nonnumeric') return None? It could do that, but it shouldn't, because returning magic values instead of raising exceptions is usually a bad, bad idea. > (A related question - why can't I just go 'if record = method(): use > (rec

Re: please help shrink this each_with_index() implementation

2010-01-05 Thread Steven D'Aprano
On Tue, 05 Jan 2010 15:30:09 -0800, Phlip wrote: >> > Does it say how to convert a string containing either an integer >> > representation, or something alphabetic, into an integer, or a zero, >> > in like 1 method call? (No except: ?) >> >> If you mean something like this: >> >> >>> int('153') >>

Re: Exception as the primary error handling mechanism?

2010-01-05 Thread Steven D'Aprano
On Tue, 05 Jan 2010 17:45:58 -0800, Phlip wrote: > On Jan 5, 5:01 pm, Chris Rebert wrote: > >> > Why can't int('nonnumeric') return None? >> >> Errors should never pass silently. > > You are saying I, as the programmer, cannot decide what is an error and > what is a pass-thru. The decision is m

Re: Do I have to use threads?

2010-01-05 Thread Rodrick Brown
On Tue, Jan 5, 2010 at 11:26 PM, aditya shukla wrote: > Hello people, > > I have 5 directories corresponding 5 different urls .I want to download > images from those urls and place them in the respective directories.I have > to extract the contents and download them simultaneously.I can extract t

Re: Do I have to use threads?

2010-01-05 Thread Brian J Mingus
On Tue, Jan 5, 2010 at 9:36 PM, Philip Semanchuk wrote: > > On Jan 5, 2010, at 11:26 PM, aditya shukla wrote: > > Hello people, >> >> I have 5 directories corresponding 5 different urls .I want to download >> images from those urls and place them in the respective directories.I have >> to extrac

Re: Minor bug in multiprocessing?

2010-01-05 Thread Frank Millman
"Aahz" wrote: > Frank Millman wrote: >> >>Is this worth reporting, if it has not been reported already? > > Defiitely report it. Thanks, Aahz. I took the lack of responses to indicate that there was no reason *not* to report it, so I reported it on 24th December (issue 7571), and it was fixed

Re: [Python] Re: Printing plain text with exact positioning on Windows

2010-01-05 Thread Chris Gonnerman
KvS wrote: Sorry, one more. I completely forgot it's not exactly plain text, but occasionally also a limited number of non-ASCII characters (accents in names etc.). Would this be possible through your method? If Windows can print it, then MSWinPrint.py should be able to also. But I haven't tes

chown'ing by script

2010-01-05 Thread Victor Subervi
Hi; I have a script that is called via the web. This script writes another script that is also called by the web, which in turn needs to have execution privileges. The problem is that the programmatically created file is owned by apache.apache and thus doesn't have execution privileges. I've tried

Re: Do I have to use threads?

2010-01-05 Thread aditya shukla
Thanks.i will look into multiprocessing. Aditya -- http://mail.python.org/mailman/listinfo/python-list

Re: chown'ing by script

2010-01-05 Thread Cameron Simpson
On 06Jan2010 01:21, Victor Subervi wrote: | I have a script that is called via the web. This script writes another | script that is also called by the web, which in turn needs to have execution | privileges. The problem is that the programmatically created file is owned | by apache.apache and thus

Re: chown'ing by script

2010-01-05 Thread Carsten Haese
Victor Subervi wrote: > Hi; > I have a script that is called via the web. This script writes another > script that is also called by the web, which in turn needs to have > execution privileges. The problem is that the programmatically created > file is owned by apache.apache and thus doesn't have e

Re: please help shrink this each_with_index() implementation

2010-01-05 Thread alex23
Steven D'Aprano wrote: > Stick around and you might learn something, > but if you bite every time somebody tries to teach you, you'll soon run > out of people willing to help you. The ongoing crowdsourced development by this group of "Victor Subervi's" project would seem to indicate that this isn

Re: Exception as the primary error handling mechanism?

2010-01-05 Thread Benjamin Kaplan
On Tue, Jan 5, 2010 at 8:45 PM, Phlip wrote: > > Here's a super easy example: > >  { 42: 'forty two' }.get(41, None) > > Because I can supply a default, I can decide what is an error and what > is . > > Now the equivalent in a language that does not enjoy this false "Zen": > >  { 42: 'forty two' }

TypeError

2010-01-05 Thread Victor Subervi
Hi; I get this error: /var/www/html/angrynates.com/christians/cart/simplemail/mail.py 153 154 ''' 155 commitSale() 156 myMail() 157 print ''' commitSale = /var/www/html/angrynates.com/christians/cart/simplemail/mail.py in commitSale() 98 cursor.execute('select max(ID) from %sC

Re: chown'ing by script

2010-01-05 Thread Victor Subervi
On Wed, Jan 6, 2010 at 1:41 AM, Carsten Haese wrote: > Victor Subervi wrote: > > Hi; > > I have a script that is called via the web. This script writes another > > script that is also called by the web, which in turn needs to have > > execution privileges. The problem is that the programmatically

Re: chown'ing by script

2010-01-05 Thread alex23
Carsten Haese wrote: > What is the underlying problem you're trying to solve with this > approach? To be paid for developing a web site shopping cart without actually having to learn Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: Do I have to use threads?

2010-01-05 Thread Gary Herron
aditya shukla wrote: Hello people, I have 5 directories corresponding 5 different urls .I want to download images from those urls and place them in the respective directories.I have to extract the contents and download them simultaneously.I can extract the contents and do then one by one. My

<    1   2