Re: Help with small program

2006-12-29 Thread Tim Roberts
[EMAIL PROTECTED] wrote: > >Interesting impl in Python! I am wondering what if the requirement is >to find the minimum number of coins which added to the "fin" sum... Given the set of coins in the original problem (100, 10, 5, 1, 0.5), the solution it provides will always be optimal. Even if we c

Re: I want to see all the variables

2006-12-29 Thread Gabriel Genellina
At Friday 29/12/2006 13:17, Steven D'Aprano wrote: >>> X.__dict__ {'__module__': '__main__', '__doc__': None} >>> X.__name__ 'X' >>> X.__bases__ () Now that's interesting... if __name__ and __bases__ don't live in the class __dict__, where do they live? What other methods and attributes are inv

Re: Starting a child process and getting its stdout?

2006-12-29 Thread Gabriel Genellina
At Friday 29/12/2006 12:22, cypher543 wrote: Thank you for the examples, but I have tried all of that before. No matter what I do, my program always hangs while it waits for the process to exit and then it prints all of the output at once. I've tried read(), readline(), readlines(), communicate(

Weekly Python Patch/Bug Summary

2006-12-29 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 413 open ( -7) / 3521 closed (+11) / 3934 total ( +4) Bugs: 946 open ( +2) / 6400 closed ( +9) / 7346 total (+11) RFE : 248 open ( -1) / 246 closed ( +1) / 494 total ( +0) New / Reopened Patches __ Auto-comp

Re: textwrap.dedent replaces tabs?

2006-12-29 Thread Tom Plunket
OKB (not okblacke) wrote: > > (You dedent common leading tabs, except if preceded by common leading > > spaces (?)). > > There cannot be common leading tabs if they are preceded by > anything. If they were preceded by something, they wouldn't be > "leading". Right, but 'common leading w

Re: Starting a child process and getting its stdout?

2006-12-29 Thread Tom Plunket
Gabriel Genellina wrote: > Did you *actually* tried what Tom Plunket posted? Two tiny chars make > a difference. The sad irony is that before taking off for vacation I was struggling at work with the same problem in some sense. I couldn't figure out why for some processes I got all of the outpu

Re: Anyone persuaded by "merits of Lisp vs Python"?

2006-12-29 Thread xscottg
Paddy3118 wrote: > This month there was/is a 1000+ long thread called: > "merits of Lisp vs Python" > In comp.lang.lisp. > > If you followed even parts of the thread, AND previously > used only one of the languages AND (and this is the > crucial bit), were persuaded to have a more positive view >

Re: Managing a queue of subprocesses?

2006-12-29 Thread Tom Plunket
cypher543 wrote: > self.buildPID = subprocess.Popen(buildCmd, stdout = subprocess.PIPE, stderr = > subprocess.STDOUT) Instead of calling it self.buildPID, you might just call it self.buildProcess or something. It's actually a Popen object that gets returned. So yes you can do what you want: _

Re: Can I beat perl at grep-like processing speed?

2006-12-29 Thread Nick Craig-Wood
js <[EMAIL PROTECTED]> wrote: > Just my curiosity. > Can python beats perl at speed of grep-like processing? > > $ wget http://www.gutenberg.org/files/7999/7999-h.zip > $ unzip 7999-h.zip > $ cd 7999-h > $ cat *.htm > bigfile > $ du -h bigfile > du -h bigfile > 8.2M bigfile > > #!/usr/l

Re: Easiest way to print from XP/DOS.

2006-12-29 Thread Tom Plunket
jim-on-linux wrote: > When the client runs the utility program the > output file is built but nothing prints and no > messages appear. If the file has a '.txt' extension, you could try os.system'ing "start ", which'll make the file pop open with notepad (or whatever happens to be associated wi

Re: No way to set a timeout in "urllib".

2006-12-29 Thread John Nagle
[EMAIL PROTECTED] wrote: > John> There's no way to set a timeout if you use "urllib" to open a URL. > John> "HTTP", which "urllib" uses, supports this, but the functionality > John> is lost at the "urllib" level. > > John> It's not available via "class URLopener" or "FancyURLop

Re: File write() problem

2006-12-29 Thread Tim Roberts
[EMAIL PROTECTED] wrote: >Alright, I realize this is probably very basic to be posted on this >newsgroup but I cannot figure out what is causing my problem. Here is >the code I am using below: > >from getpass import getpass > >configfile = file('config.txt', 'w') >serverPassword = configfile.readl

Re: DOS, UNIX and tabs

2006-12-29 Thread Tim Roberts
"Ben" <[EMAIL PROTECTED]> wrote: > >Great - that worked.Thanks! >Is that a general method in linux you can always use to redirect >standard output to a file? Works in Windows, too. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-

<    1   2