Thread limit and thread stack size

2008-11-25 Thread blair . bethwaite
Hi All, We've been debugging a distributed app that uses a database server to accept connections and then queries from remote agents. Once a connection is established it is passed off to a thread, along with a local db connection from a pool, to handle the IO. We get to a point that seems to be a

Re: Subprocess or Process or OMG!!

2006-05-18 Thread blair . bethwaite
rh0dium wrote: > This has several problems - least of which args aren't working Has > anyone really tried this approach? No, they just wrote the code for the hell of it. :) Seriously though, you may want to consider using the popen2 module. Then you'll be able to wait on the subprocess to r

Re: Enumerating Regular Expressions

2006-05-09 Thread blair . bethwaite
Dale Strickland-Clark wrote: > Any regular expression that has an asterisk in it has an infinite number of > possible matches. > > If it has two asterisks, that's an infinite number squared and that's a > really big number. > > You wouldn't want to print them out. We've been over this already. Wh

Re: Enumerating Regular Expressions

2006-05-08 Thread blair . bethwaite
Michael J. Fromberger wrote: > > You see the difficulty don't you? How will the computer know in advance > > that the regex matches only a finite set of possible strings? > > You don't. Hence, you want something that behaves like a generator, and > will produce the strings one at a time. Preferab

Re: Enumerating Regular Expressions

2006-05-08 Thread blair . bethwaite
James Stroud wrote: > You see the difficulty don't you? How will the computer know in advance > that the regex matches only a finite set of possible strings? Well sure it might be a little difficult to figure _that_ out, although probably not all that hard if you converted to an FSA or something.

Re: Enumerating Regular Expressions

2006-05-08 Thread blair . bethwaite
James Stroud wrote: > You mean like re.compile(r'.*') ? No. I mean like: >>> regex = re.compile(r'a|b') >>> regex.enumerate() a b >>> -- http://mail.python.org/mailman/listinfo/python-list

Enumerating Regular Expressions

2006-05-08 Thread blair . bethwaite
Hi all, Does anybody know of a module that allows you to enumerate all the strings a particular regular expression describes? Cheers, -Blair -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting HTTP responses - a python linkchecking script.

2006-05-08 Thread blair . bethwaite
Rene Pijlman wrote: > [EMAIL PROTECTED]: > >with urllib2 it doesn't seem possible to get HTTP status codes. > > except urllib2.HTTPError, e: > if e.code == 403: Thanks. Is there documentation for this available somewhere online, I can't see it to obviously in the library refer

Re: utility functions within a class?

2006-05-07 Thread blair . bethwaite
John Salerno wrote: > What I originally meant was that they would not be called from an > instance *outside* the class itself, i.e. they won't be used when > writing another script, they are only used by the class itself. Yep, so you want to encapsulate the functionality that those methods provide

Re: utility functions within a class?

2006-05-07 Thread blair . bethwaite
John Salerno wrote: > Ugh, sorry about another post, but let me clarify: In these utility > functions, I need to refer to an attribute of an instance, but these > functions will be called from another method in the class, not from the > instance itself. Is this even possible, or would 'self' have n

Re: utility functions within a class?

2006-05-07 Thread blair . bethwaite
> You do *NOT* want to put double-underscores before and after a method > name. That does not indicate a private method, it indicates a "magic > method" WHOOPS!! Sorry, I haven't touched python for a few months and just started working on a script this morning so was going to post my own questio

Getting HTTP responses - a python linkchecking script.

2006-05-07 Thread blair . bethwaite
Hi Folks, I'm thinking about writing a script that can be run over a whole site and produce a report about broken links etc... I've been playing with the urllib2 and httplib modules as a starting point and have found that with urllib2 it doesn't seem possible to get HTTP status codes. I've had m

Re: utility functions within a class?

2006-05-07 Thread blair . bethwaite
It sounds like all you want is some encapsulation, the following makes methods __head__ and __body__ "private" - the double underscores are important. I'd suggest reading the Object bits of the python tutorial also. class HTMLWrapper: def generate(self, ...): ... self.__head__(foo