Re: checking that process binds a port, fuser functionality

2010-08-03 Thread Zdenek Maxa
Original Message Subject: Re: checking that process binds a port, fuser functionality From: Roy Smith To: python-list@python.org Date: Tue Aug 03 2010 13:06:27 GMT+0200 (CEST) > In article , > Nobody wrote: > >> On Mon, 02 Aug 2010 23:27:37 +0200, Zd

checking that process binds a port, fuser functionality

2010-08-02 Thread Zdenek Maxa
Hello, I need to start a process (using subprocess.Popen()) and wait until the new process either fails or successfully binds a specified port. The fuser command seems to be indented exactly for this purpose. Could anyone please provided a hint to a handy Python library to do this or would the adv

urllib2.urlopen timeout

2009-08-03 Thread Zdenek Maxa
Hi, I would like to ask how I should set timeout for a call: f = urllib2.urlopen(url) I am using Python 2.5. I have already tried socket.setdefaulttimeout(3). However, this adversely affects other connections the application makes, since it seems to affect all socket connections. I know that Py

Tkinter.Canvas thread safety problem?

2009-07-07 Thread Zdenek Maxa
Hello, I have started a project using Tkinter. The application performs some regular checks in a thread and updates Canvas components. I have observed that sometimes the application hangs when it is about to call canvas.itemconfig() when the thread is about to terminate in the next loop. Experime

Re: multiline regular expression (replace)

2007-05-30 Thread Zdenek Maxa
> > b="(I[\s\S]*line)" > > print re.search(b, a,re.MULTILINE).group(1) > > > gives > > I Am > Multiline > > Be aware that . matches NO newlines!!! > May be this caused your problems? > > regards > Holger > > &

Re: multiline regular expression (replace)

2007-05-29 Thread Zdenek Maxa
[EMAIL PROTECTED] wrote: > On May 29, 2:03 am, Zdenek Maxa <[EMAIL PROTECTED]> wrote: > >> Hi all, >> >> I would like to perform regular expression replace (e.g. removing >> everything from within tags in a XML file) with multiple-line pattern. >> How c

multiline regular expression (replace)

2007-05-29 Thread Zdenek Maxa
Hi all, I would like to perform regular expression replace (e.g. removing everything from within tags in a XML file) with multiple-line pattern. How can I do this? where = open("filename").read() multilinePattern = "^ <\/tag>$" re.search(multilinePattern, where, re.MULTILINE) Thanks great