Re: non-blocking PIPE read on Windows

2006-08-04 Thread Paul Du Bois
placid wrote: > What i need to do is, create a process using subprocess.Popen, where > the subprocess outputs information on one line (but the info > continuesly changes and its always on the same line) and read this > information without blocking, so i can retrieve other data from the > line i rea

Re: genexp surprise (wart?)

2006-05-25 Thread Paul Du Bois
The generator is in its own scope. For proof, try accessing q outside the generator. There are two possibilities. The first is that you don't know what closures are and are complaining that python has them. That would be amusingly ironic, but I'm guessing you do know (if you don't, google "make_ad

TypeError + generator + str.join(): Bug or user error?

2006-04-10 Thread Paul Du Bois
Using win32 python 2.4.1, I have a minimal test program: def generate(): raise TypeError('blah') yield "" print "\n".join((generate())) Executing the program gives: Traceback (most recent call last): File "", line 5, in ? TypeError: sequence expected, generator found replacing TypeEr

Re: Overcoming herpetophobia (or what's up w/ Python scopes)?

2005-06-20 Thread Paul Du Bois
kj wrote: > I am hoping that it may be better this time around. For one thing, > like Perl, Python was then (and maybe still is) a "work in progress." > So I figure that Python scoping may have improved since then. Even > if not, I think that Python is mature enough by now that adequate > alterna

Re: Example Code - Named Pipes (Python 2.4 + ctypes on Windows)

2005-03-26 Thread Paul Du Bois
Srijit Kumar Bhadra wrote: > However, I wish that there was more documentation of win32all beyond > existing PyWin32.chm. I suspect you have already used the "more documentation" -- it's the MSDN docs. p -- http://mail.python.org/mailman/listinfo/python-list

Re: Securing a future for anonymous functions in Python

2004-12-31 Thread Paul Du Bois
Alex Martelli wrote: > We should have an Evilly Cool Hack of the Year, and I nominate Paul du > Bois's one as the winner for 2004. Do I hear any second...? Thank you :-) I am busy writing it up as a recipe. I think I have a pleasing way for it to be portable, even. Unfortunately, that removes

Re: Deadlock detection

2004-12-06 Thread Paul Du Bois
(warning: pedantic and off-topic response) NP-Complete does not mean "equivalent to the halting problem." It means "poly-time equivalent to any other NP-Complete problem". NP-Complete problems are "only" exponential-time. The halting problem is much harder! And of course, just the fact that a prob