Re: Program inefficiency?

2007-10-01 Thread Florian Schmidt
On Sat, Sep 29, 2007 at 12:05:26PM -0700, thebjorn wrote: > Ok, if you want a single RE... How about: >... > r = re.compile(r''' > (?:href=['"][^#]+[#]([^"']+)["']) > | (?:name=['"]?([^'">]+)) > ''', re.IGNORECASE | re.MULTILINE | re.DOTALL | re.VERBOSE) maybe a little bit easier to

Re: Limits on search length

2007-10-01 Thread Florian Schmidt
ot;, data) >>> m.start(), m.end() (1024, 1296) or even bigger: >>> data = "-" * 1024 + "l" * 2048+ "*" * 1024 >>> m = re.search("l{2048}", data) >>> m.start(), m.end() (1024, 3072) so i dont think you are hitting an re matching limit. could you post your searchPattern? -- Florian Schmidt // www.fastflo.de -- http://mail.python.org/mailman/listinfo/python-list

Re: Limits on search length

2007-10-01 Thread Florian Schmidt
On Mon, Oct 01, 2007 at 08:33:28PM +0200, Florian Schmidt wrote: > could you post your searchPattern? sorry. now i see you already posted your search pattern!:) r".{272}" -- Florian Schmidt // www.fastflo.de -- http://mail.python.org/mailman/listinfo/python-list

Re: image python

2007-10-01 Thread Florian Schmidt
can again create a set from this list: >>> set(map(lambda cv: len(set(cv[1])), im.getcolors())) set([1]) so "im" is an grayscale image even though it has three channels. this method does not always work: - with indexed image data, - with another definition/understanding of "gray" pixels but maybe PIL can help you anyway! flo. -- Florian Schmidt // www.fastflo.de -- http://mail.python.org/mailman/listinfo/python-list

Re: Import PY file not included in py2exe executable

2007-10-04 Thread Florian Schmidt
, my_config.db_user...) so you can always call read_config() to re-read the configuration and have all python features in that config file. (additionally you can catch exceptions and check the config files' mtime if it has changed...) that way py2exe won't care about your