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

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: 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

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: 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' }

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: 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: 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: 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

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: [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

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: 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: 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: 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: 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 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: 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: 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

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: 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

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: 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: 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: 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: 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: 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: 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: 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: Exception as the primary error handling mechanism?

2010-01-05 Thread Phlip
> Errors should never pass silently. > Unless explicitly silenced. > -- The Zen of Python (http://www.python.org/dev/peps/pep-0020/) "The person who says it cannot be done should never interrupt the person doing it" -- http://mail.python.org/mailman/listinfo/python-list

Re: twenty years ago Guido created Python

2010-01-05 Thread Daniel Fetchinson
>>> Python is a truly awesome programming language. Not only is Guido a >>> genius language designer, but he is also a great project leader. What >>> an accomplishment. Congratulations to everybody who has contributed >>> to Python in the last two decades! >> >> The more languages you learn befo

Re: unittest inconsistent

2010-01-05 Thread Phlip
On Jan 5, 4: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: Exception as the primary error handling mechanism?

2010-01-05 Thread Phlip
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 me. (Yes yes I can write int_or_None(), etc...) Here's

Re: Exception as the primary error handling mechanism?

2010-01-05 Thread r0g
Lie Ryan wrote: > On 1/6/2010 1:48 AM, r0g wrote: >> Steven D'Aprano wrote: >>> On Tue, 05 Jan 2010 13:06:20 +, r0g wrote: If that's the case how can you expect it to validate anything at all in production? >>> >>> The asserts still operate so long as you don't use the -O switch.

Re: Exception as the primary error handling mechanism?

2010-01-05 Thread Chris Rebert
On Tue, Jan 5, 2010 at 3:51 PM, Phlip wrote: > Peng Yu wrote: >> Otherwise, could some python expert explain to me why exception is >> widely used for error handling in python? Is it because the efficiency >> is not the primary goal of python? > > It's not about efficiency, it's about making assum

Re: Exception as the primary error handling mechanism?

2010-01-05 Thread r0g
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* me >>> off. >> Well, if being told “no” is going to p

Re: please help shrink this each_with_index() implementation

2010-01-05 Thread Mackrackit
On Jan 5, 2010, at 4:30 PM, Phlip 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. So I will persist in my idio

Re: subprocess.Popen does not close pipe in an error case

2010-01-05 Thread Steven K. Wong
BTW, I'm using Python 2.6.2 on Linux. -- http://mail.python.org/mailman/listinfo/python-list

Re: Exception as the primary error handling mechanism?

2010-01-05 Thread Phlip
Peng Yu wrote: > Otherwise, could some python expert explain to me why exception is > widely used for error handling in python? Is it because the efficiency > is not the primary goal of python? It's not about efficiency, it's about making assumptions for the programmer about what kind of rigor th

subprocess.Popen does not close pipe in an error case

2010-01-05 Thread Steven K. Wong
Below, I have a Python script that launches 2 child programs, prog1 and prog2, with prog1's stdout connected to prog2's stdin via a pipe. (It's like executing "prog1 | prog2" in the shell.) If both child programs exit with 0, then the script runs to completion. But if prog2 exits with non-0, prog1

Re: please help shrink this each_with_index() implementation

2010-01-05 Thread Phlip
> > 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') > > 153 The point: int('') or int('something') both throw

Re: please help shrink this each_with_index() implementation

2010-01-05 Thread Steven D'Aprano
On Tue, 05 Jan 2010 14:40:49 -0800, Phlip wrote: > On Jan 5, 1:10 pm, Antoine Pitrou wrote: > >> http://docs.python.org/library/functions.html >> >> Don't forget that the Python documentation is rich and structured. And >> good luck. > > Does it say how to convert a string containing either an

Re: Exception as the primary error handling mechanism?

2010-01-05 Thread Steven D'Aprano
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* me >> off. > > Well, if being told “no” is going to piss you off, I think you're i

Re: Python multiprocessing: Permission denied

2010-01-05 Thread Steven D'Aprano
On Tue, 05 Jan 2010 13:52:18 -0800, t0ster wrote: > It looks like the user don't have permission to access shared memory. > When executing with root privileges it works fine. > > Is there any solution to run it as normal user(not root)? Then give the user permission to access shared memory. Why

Re: please help shrink this each_with_index() implementation

2010-01-05 Thread Phlip
On Jan 5, 1:10 pm, Antoine Pitrou wrote: > http://docs.python.org/library/functions.html > > Don't forget that the Python documentation is rich and structured. > And good luck. Does it say how to convert a string containing either an integer representation, or something alphabetic, into an integ

Re: Exception as the primary error handling mechanism?

2010-01-05 Thread Ben Finney
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* me > off. Well, if being told “no” is going to piss you off, I think you're in for a rough time. > Having said that I find the mental image of

Re: parsing an Excel formula with the re module

2010-01-05 Thread MRAB
Mensanator wrote: On Jan 5, 12:35 pm, MRAB wrote: vsoler wrote: Hello, I am acessing an Excel file by means of Win 32 COM technology. For a given cell, I am able to read its formula. I want to make a map of how cells reference one another, how different sheets reference one another, how workbo

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

2010-01-05 Thread Ned Deily
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 someone would > have noticed that). The missing preferences is

Python multiprocessing: Permission denied

2010-01-05 Thread t0ster
Hi guys, I'm getting an error when trying to execute python program that uses multiprocessing package: File "/usr/local/lib/python2.6/multiprocessing/__init__.py", line 178, in RLock return RLock() File "/usr/local/lib/python2.6/multiprocessing/synchronize.py", line 142, in __init__ Se

Re: Dynamic text color

2010-01-05 Thread Dave McCormick
John Posner wrote: On Tue, 05 Jan 2010 15:08:04 -0500, Dave McCormick wrote: It sounds like the program is doing exactly what you TOLD it to do (which might not be what you WANT it to do): 1. In an earlier pass on the text, color the string "dog" red. 2. In a later pass, color the strin

Commands for a breakpoint in .pdbrc

2010-01-05 Thread Pablo Torres N.
Hi all, I'd like to save the commands for a breakpoint in a .pdbrc, something like: b 81 commands 1 pp foo.attr1 pp foo.attr2 end b 108 commands 2 pp bar.attr1 pp bar.attr2 end This would automate setting the environment for the debugging session. However, this does not work with 'python -m pdb

Re: A null program - what is it doing?

2010-01-05 Thread Gib Bogle
r0g wrote: Gib Bogle wrote: No doubt a dumb question from a noob: The following program (a cut down version of some test code) uses no CPU, and does not terminate: import sys from PyQt4.QtCore import * if __name__=="__main__": app = QCoreApplication(sys.argv) sys.exit(app.exec_()) Wh

Re: please help shrink this each_with_index() implementation

2010-01-05 Thread Antoine Pitrou
>> Couldn't you just use the built-in enumerate() to replace the whole >> thing? > > Because that would involve, like, reading an entire Python book just to > locate that method? Actually, no. It just involves reading one of the most important pages in the documentation, the page which describ

Re: please help shrink this each_with_index() implementation

2010-01-05 Thread Phlip
> > My Pythonic sequencing skills are obviously feeble. Can anything think > > of a way to write that in fewer lines? Thanks, all! > Couldn't you just use the built-in enumerate() to replace the whole thing? Because that would involve, like, reading an entire Python book just to locate that meth

Re: Dynamic text color

2010-01-05 Thread John Posner
On Tue, 05 Jan 2010 15:08:04 -0500, Dave McCormick wrote: It's certainly a mistake to use the expression "str(rList).split()". Using str() to convert the list "rList" into a string creates a mess that includes square-bracket characters. Did this actually work for you? It sort of worked

Re: please help shrink this each_with_index() implementation

2010-01-05 Thread Marco Nawijn
On Jan 5, 8:58 pm, Phlip wrote: > Hypo Nt: > > def each_with_index(seq): >     index = 0 >     result = [] > >     for item in seq: >       result.append([item, index]) >       index += 1 > >     return result > > My Pythonic sequencing skills are obviously feeble. Can anything think > of a way to

Re: please help shrink this each_with_index() implementation

2010-01-05 Thread Carsten Haese
Phlip wrote: > Hypo Nt: > > def each_with_index(seq): > index = 0 > result = [] > > for item in seq: > result.append([item, index]) > index += 1 > > return result > > My Pythonic sequencing skills are obviously feeble. Can anything think > of a way to write that in f

Re: please help shrink this each_with_index() implementation

2010-01-05 Thread akean
On Jan 6, 8:58 am, Phlip wrote: > Hypo Nt: > > def each_with_index(seq): >     index = 0 >     result = [] > >     for item in seq: >       result.append([item, index]) >       index += 1 > >     return result > > My Pythonic sequencing skills are obviously feeble. Can anything think > of a way to

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

2010-01-05 Thread Benjamin Kaplan
On Tue, Jan 5, 2010 at 3:03 PM, Dave McCormick wrote: > > > aung paing Soe wrote: > > -- Forwarded message -- > From: aung paing Soe > Date: Tue, Jan 5, 2010 at 11:27 AM > Subject: I would like to install Python on my 64 bit Win 7 > To: webmas...@python.org > > > Hello , >    

Re: twenty years ago Guido created Python

2010-01-05 Thread Mensanator
On Jan 5, 8:22 am, n00m wrote: > Stick your English into your ass Most people would say "up your ass". And use a period at the end of the sentence. Got any more funny insults? -- http://mail.python.org/mailman/listinfo/python-list

Re: Dynamic text color

2010-01-05 Thread Dave McCormick
John Posner wrote: Dave, you're doing exactly the right thing: gradually expanding your program, to provide more functionality and to learn more about the available programming tools. It's also very good that you take care to close() the file after processing it. Now for the bad news ... S

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

2010-01-05 Thread Dave McCormick
aung paing Soe wrote: -- Forwarded message -- From: aung paing Soe Date: Tue, Jan 5, 2010 at 11:27 AM Subject: I would like to install Python on my 64 bit Win 7 To: webmas...@python.org Hello ,   I would like to study about Python Pr

please help shrink this each_with_index() implementation

2010-01-05 Thread Phlip
Hypo Nt: def each_with_index(seq): index = 0 result = [] for item in seq: result.append([item, index]) index += 1 return result My Pythonic sequencing skills are obviously feeble. Can anything think of a way to write that in fewer lines? -- Phlip http://c2.com/c

Re: parsing an Excel formula with the re module

2010-01-05 Thread vsoler
On 5 ene, 20:21, vsoler wrote: > On 5 ene, 20:05, Mensanator wrote: > > > > > On Jan 5, 12:35 pm, MRAB wrote: > > > > vsoler wrote: > > > > Hello, > > > > > I am acessing an Excel file by means of Win 32 COM technology. > > > > For a given cell, I am able to read its formula. I want to make a ma

Re: parsing an Excel formula with the re module

2010-01-05 Thread Tim Chase
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 other *.xls files? Where things

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

2010-01-05 Thread aung paing Soe
-- Forwarded message -- From: aung paing Soe Date: Tue, Jan 5, 2010 at 11:27 AM Subject: I would like to install Python on my 64 bit Win 7 To: webmas...@python.org Hello , I would like to study about Python Programming . So I want to install Python . But my laptop is Wi

Re: parsing an Excel formula with the re module

2010-01-05 Thread vsoler
On 5 ene, 20:05, Mensanator wrote: > On Jan 5, 12:35 pm, MRAB wrote: > > > > > vsoler wrote: > > > Hello, > > > > I am acessing an Excel file by means of Win 32 COM technology. > > > For a given cell, I am able to read its formula. I want to make a map > > > of how cells reference one another, ho

Re: twenty years ago Guido created Python

2010-01-05 Thread Steve Holden
Phlip wrote: > On Dec 31 2009, 2:06 pm, Steve Howell wrote: > >> Python is a truly awesome programming language. Not only is Guido a >> genius language designer, but he is also a great project leader. What >> an accomplishment. Congratulations to everybody who has contributed >> to Python in t

Re: parsing an Excel formula with the re module

2010-01-05 Thread MRAB
vsoler wrote: On 5 ene, 19:35, MRAB wrote: vsoler wrote: Hello, I am acessing an Excel file by means of Win 32 COM technology. For a given cell, I am able to read its formula. I want to make a map of how cells reference one another, how different sheets reference one another, how workbooks ref

Re: Printing plain text with exact positioning on Windows

2010-01-05 Thread Nobody
On Tue, 05 Jan 2010 04:40:14 -0800, KvS wrote: >> Did you mean borderless printing? >> Every printer needs his margins, some more some less. Some printers have the >> ability to do borderless printing but usualy they can do it only on special >> or photo paper. So you can adjust the pdf as you wis

Re: Speeding up network access: threading?

2010-01-05 Thread Steve Holden
Jens Müller wrote: > Hi and sorry for double posting - had mailer problems, > >> Terry said "queue". not "list". Use the Queue class (it's thread-safe) >> in the "Queue" module (assuming you're using Python 2.x; in Python 3.x >> it's called the "queue" module). > > Yes yes, I know. I use a queue

Re: What is the best data structure for a very simple spreadsheet?

2010-01-05 Thread vsoler
On 3 ene, 22:40, mdipierro wrote: > Perhaps this can be useful:http://www.web2py.com/examples/spreadsheet > > The code is in a single file with not dependencies and it does not > require web2py to > run:http://code.google.com/p/web2py/source/browse/gluon/contrib/spreadshe... > > Here is a sample

Re: fsync() doesn't work as advertised?

2010-01-05 Thread Nobody
On Mon, 04 Jan 2010 08:09:56 -0800, Brian D wrote: > If I'm running a process in a loop that runs for a long time, I > occasionally would like to look at a log to see how it's going. > > I know about the logging module, and may yet decide to use that. > > Still, I'm troubled by how fsync() doesn

Re: parsing an Excel formula with the re module

2010-01-05 Thread Mensanator
On Jan 5, 12:35 pm, MRAB wrote: > vsoler wrote: > > Hello, > > > I am acessing an Excel file by means of Win 32 COM technology. > > For a given cell, I am able to read its formula. I want to make a map > > of how cells reference one another, how different sheets reference one > > another, how work

Re: parsing an Excel formula with the re module

2010-01-05 Thread John Posner
On Tue, 05 Jan 2010 13:12:00 -0500, vsoler wrote: Hello, I am acessing an Excel file by means of Win 32 COM technology. For a given cell, I am able to read its formula. I want to make a map of how cells reference one another, how different sheets reference one another, how workbooks reference

Re: parsing an Excel formula with the re module

2010-01-05 Thread vsoler
On 5 ene, 19:35, MRAB wrote: > vsoler wrote: > > Hello, > > > I am acessing an Excel file by means of Win 32 COM technology. > > For a given cell, I am able to read its formula. I want to make a map > > of how cells reference one another, how different sheets reference one > > another, how workboo

Re: twenty years ago Guido created Python

2010-01-05 Thread Phlip
On Dec 31 2009, 2:06 pm, Steve Howell wrote: > Python is a truly awesome programming language.  Not only is Guido a > genius language designer, but he is also a great project leader.  What > an accomplishment.  Congratulations to everybody who has contributed > to Python in the last two decades!

Re: IOError - cannot create file (linux daemon-invoked script)

2010-01-05 Thread Nobody
On Mon, 04 Jan 2010 21:30:31 -0800, cassiope wrote: > One more tidbit observed: my last note, that it works when using > seteuid/setegid? > Well - that only applies if the daemon is running under strace (!). > It fails > if started directly by root, or if the strace session has ended, > leaving th

Re: Speeding up network access: threading?

2010-01-05 Thread Jens Müller
Hi and sorry for double posting - had mailer problems, Terry said "queue". not "list". Use the Queue class (it's thread-safe) in the "Queue" module (assuming you're using Python 2.x; in Python 3.x it's called the "queue" module). Yes yes, I know. I use a queue to realize the thread pool queue,

Re: parsing an Excel formula with the re module

2010-01-05 Thread MRAB
vsoler wrote: Hello, I am acessing an Excel file by means of Win 32 COM technology. For a given cell, I am able to read its formula. I want to make a map of how cells reference one another, how different sheets reference one another, how workbooks reference one another, etc. Hence, I need to pa

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

2010-01-05 Thread Mensanator
On Jan 5, 12:32 am, Ned Deily wrote: > In article > <0d70cb54-3d77-4176-b621-e764ecf61...@26g2000yqo.googlegroups.com>, > > > > > >  Mensanator wrote: > > I assume I've been using the IDLE from macports. From the command > > prompt I've > > been typing "idle". This launches a "shell" window which

Re: Printing plain text with exact positioning on Windows

2010-01-05 Thread KvS
On Jan 5, 12:56 pm, Chris Gonnerman wrote: > KvS wrote: > > ... can I adjust the options normally appearing in > > the Printing Dialog through Python? > > Yes, if you use my method or my module, as I gave in my previous post.   > If you use Adobe Reader to print, I'm not sure how to automate the p

parsing an Excel formula with the re module

2010-01-05 Thread vsoler
Hello, I am acessing an Excel file by means of Win 32 COM technology. For a given cell, I am able to read its formula. I want to make a map of how cells reference one another, how different sheets reference one another, how workbooks reference one another, etc. Hence, I need to parse Excel formul

Re: Dynamic text color

2010-01-05 Thread John Posner
On Tue, 05 Jan 2010 10:31:09 -0500, Dave McCormick wrote: ... But this is what I have so far. ## file = 'red.txt' file = open("red.txt","r") rList = file.readlines() file.close() redList = str(rList).split() Dave, you're doing exactly the right thing: gradually expanding your

Re: Exception as the primary error handling mechanism?

2010-01-05 Thread Steve Holden
D'Arcy J.M. Cain wrote: > On 05 Jan 2010 14:02:50 GMT > Steven D'Aprano wrote: >> shouldn't use assert for validating user data except for quick-and-dirty >> scripts you intend to use once and throw away. > > A mythcial beast that has yet to be spotted in the wild. > Not true (he wrote, picking

Re: Speeding up network access: threading?

2010-01-05 Thread Antoine Pitrou
Le Tue, 05 Jan 2010 15:04:56 +0100, Jens Müller a écrit : > > Is a list thrad-safe or do I need to lock when adding the results of my > worker threads to a list? The order of the elements in the list does not > matter. The built-in list type is thread-safe, but is doesn't provide the waiting fea

Re: Exception as the primary error handling mechanism?

2010-01-05 Thread Lie Ryan
On 1/6/2010 1:48 AM, r0g wrote: Steven D'Aprano wrote: On Tue, 05 Jan 2010 13:06:20 +, r0g wrote: If that's the case how can you expect it to validate anything at all in production? The asserts still operate so long as you don't use the -O switch. Do you mean for debugging in situ or so

Re: Speeding up network access: threading?

2010-01-05 Thread MRAB
Jens Müller wrote: Hello, The fairly obvious thing to do is use a queue.queue for tasks and another for results and a pool of threads that read, fetch, and write. Thanks, indeed. Is a list thrad-safe or do I need to lock when adding the results of my worker threads to a list? The order of th

Re: Where's a DOM builder that uses the Builder Pattern to ... build DOMs?

2010-01-05 Thread Phlip
On Jan 5, 12:16 am, Stefan Behnel wrote: > Note that there are tons of ways to generate HTML with Python. Forgot to note - I'm generating schematic XML, and I'm trying to find a way better than the Django template I started with! -- http://mail.python.org/mailman/listinfo/python-list

Re: A null program - what is it doing?

2010-01-05 Thread John Posner
No doubt a dumb question from a noob: The following program (a cut down version of some test code) uses no CPU, and does not terminate: import sys from PyQt4.QtCore import * if __name__=="__main__": app = QCoreApplication(sys.argv) sys.exit(app.exec_()) What is the program doing?

Re: Printing plain text with exact positioning on Windows

2010-01-05 Thread KvS
On Jan 5, 12:56 pm, Chris Gonnerman wrote: > KvS wrote: > > ... can I adjust the options normally appearing in > > the Printing Dialog through Python? > > Yes, if you use my method or my module, as I gave in my previous post.   > If you use Adobe Reader to print, I'm not sure how to automate the p

Re: Printing plain text with exact positioning on Windows

2010-01-05 Thread KvS
On Jan 5, 12:56 pm, Chris Gonnerman wrote: > KvS wrote: > > ... can I adjust the options normally appearing in > > the Printing Dialog through Python? > > Yes, if you use my method or my module, as I gave in my previous post.   > If you use Adobe Reader to print, I'm not sure how to automate the p

Re: Speeding up network access: threading?

2010-01-05 Thread Jens Müller
Hello, The fairly obvious thing to do is use a queue.queue for tasks and another for results and a pool of threads that read, fetch, and write. Thanks, indeed. Is a list thrad-safe or do I need to lock when adding the results of my worker threads to a list? The order of the elements in the l

Re: Speeding up network access: threading?

2010-01-05 Thread Jens Müller
Hello, The fairly obvious thing to do is use a queue.queue for tasks and another for results and a pool of threads that read, fetch, and write. Thanks, indeed. Is a list thrad-safe or do I need to lock when adding the results of my worker threads to a list? The order of the elements in the li

Re: embedded python on mac - linking problem

2010-01-05 Thread Benjamin Kaplan
On Tue, Jan 5, 2010 at 7:33 AM, Krzysztof Kobus wrote: > Hi, > > I have a problem with linking python module with my application on mac in > order to make the module available in "embedded python". > > My python module is contained in  j3kmodule.cxx file and module > initialization function is e

Re: Exception as the primary error handling mechanism?

2010-01-05 Thread Dave Angel
r0g wrote: Dave Angel wrote: r0g wrote: Maybe, although I recently learned on here that one can't rely on assert statements in production code, their intended use is to aid debugging and testing really. Hopefully, what you learned is that you can't use assert() in product

Re: Dynamic text color

2010-01-05 Thread Dave McCormick
John Posner wrote: On Fri, 01 Jan 2010 21:01:04 -0500, Cousin Stanley wrote: I was not familiar with the re.finditer method for searching strings ... Stanley and Dave -- So far, we've just been using finditer() to perform standard-string searches (e.g. on the word "red"). Sinc

Re: ctypes: How to call unexported functions in a dll

2010-01-05 Thread Thomas Heller
Am 05.01.2010 12:19, schrieb Coert Klaver (DT): > Hi, > > I am using ctypes in python 3 on a WXP machine > > Loading a dll and using its exported functions works fine. > > Now I want to use a function in the dll that is not exported. > > In C this can be done by just casting the address in the

Re: Exception as the primary error handling mechanism?

2010-01-05 Thread r0g
Steven D'Aprano wrote: > On Tue, 05 Jan 2010 13:06:20 +, r0g wrote: >> Well maybe I didn't quite get it then, could you explain a bit further? >> >> My understanding was that asserts aren't executed at all if python is >> started with the -O or -OO option, > > Correct. > > >> or run throug

Re: twenty years ago Guido created Python

2010-01-05 Thread n00m
Stick your English into your ass -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >