Re: status of Programming by Contract (PEP 316)?

2007-08-29 Thread Dan Stromberg - Datallegro
On Tue, 28 Aug 2007 23:45:28 -0700, Russ wrote: > On Aug 28, 10:58 pm, Michele Simionato <[EMAIL PROTECTED]> > wrote: > >> Why do you think that would ad a strong positive capability? >> To me at least it seems a big fat lot of over-engineering, not >> needed in 99% of programs. In the remaining

Re: re compiled object result caching?

2007-08-29 Thread Dan Stromberg - Datallegro
On Wed, 29 Aug 2007 17:45:36 -0400, Steve Holden wrote: > Dan wrote: >> foo_re = re.compile(r"foo(bar)") >> # . . . >> if foo_re.search(line): >> foo_re.last_result().group(1) >> > If you wanted to implement this I don't really see why a method call is > necessary. It would surely only need

Re: Socket recv(1) seems to block instead of returning end of file.

2007-08-23 Thread Dan Stromberg - Datallegro
On Thu, 23 Aug 2007 11:54:01 +0200, Hendrik van Rooyen wrote: > > While doing a netstring implementation I noticed that if you > build a record up using socket's recv(1), then when you close > the remote end down, the recv(1) hangs, despite having a short > time out of 0.1 set. > > If however,

python debugging under emacs?

2007-08-21 Thread Dan Stromberg - Datallegro
Is there a debugging mode in emacs that works well with python? I tried gud, but it was giving me errors, so I thought I'd ask before I try to get it to work: Is there an emacs mode (perhaps gud) that'll give a view of the python source, and currenly executing line, the ability inspect datastruct

Re: "Variable variable name" or "variable lvalue"

2007-08-15 Thread Dan Stromberg - Datallegro
On Wed, 15 Aug 2007 10:42:02 -0700, mfglinux wrote: > Hello to everybody > > I would like to know how to declare in python a "variable name" that > it is in turn a variable > In bash shell I would wrote sthg like: > > for x in `seq 1 3` > do > M$i=Material(x) #Material is a python class > don

Screenscraping, in python, a web page that requires javascript?

2007-08-09 Thread Dan Stromberg - Datallegro
Is there a method, with python, of screenscraping a web page, if that web page uses javascript? I know about BeautifulSoup, but AFAIK at this time, BeautifulSoup is for HTML that doesn't have embedded javascript. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Subprocess module

2007-07-13 Thread Dan Stromberg - Datallegro
You could start up a pty and do your own Pexpect-like thing, using read/readline/write. However, this may not be portable to windows. Maybe if you get the python that comes with cygwin, or build your own python under the cygwin environment - that might be more likely to get you pty's under windo

Re: bash-style pipes in python?

2007-07-12 Thread Dan Stromberg - Datallegro
On Wed, 11 Jul 2007 20:55:48 -0700, faulkner wrote: > On Jul 11, 8:56 pm, Dan Stromberg - Datallegro > <[EMAIL PROTECTED]> wrote: >> I'm constantly flipping back and forth between bash and python. >> >> Sometimes, I'll start a program in one, and end up

Re: Screen Scraping Question

2007-07-11 Thread Dan Stromberg - Datallegro
On Wed, 11 Jul 2007 12:45:21 +, jeffbg123 wrote: > Hey, > > I am trying to make a bot for a flash game using python. However I am > having some trouble with a screen scraping strategy. Is there an > accepted way to compare a full screenshot with the image that I want > to locate? It is a math

bash-style pipes in python?

2007-07-11 Thread Dan Stromberg - Datallegro
I'm constantly flipping back and forth between bash and python. Sometimes, I'll start a program in one, and end up recoding in the other, or including a bunch of python inside my bash scripts, or snippets of bash in my python. But what if python had more of the power of bash-style pipes? I migh