Re: how can a child thread notify a parent thread its status?

2009-07-25 Thread scriptlear...@gmail.com
First of all, let me say thank you to all of you. I have asked many questions (some of them are dump questions), and you have kindly helped me. I am not going to reply every message to say thank-you since that would be annoying for such group with such high daily traffics. Thank you very much.

Re: how can a child thread notify a parent thread its status?

2009-07-25 Thread scriptlear...@gmail.com
I decided to go with one big log file, which will be shared by all threads (child and parent). A log message Queue is used to store all log entries, and a customized logger thread will get log entries from the Queue. #from the logger thread# def run(self): while self.flag == 1: #if

time in milliseconds by calling time.time()

2009-07-24 Thread scriptlear...@gmail.com
I am trying to measure some system response time by using the time.time () or time.clock() in my script. However, the numbers I get are in 10s of milliseconds. For example, 1248481670.34 #from time.time() 0.08 #from time.clock() That won't work for me, since the response time

passing data to a liburl2 opener object

2009-07-23 Thread scriptlear...@gmail.com
I have prepared my headers and data for a HTTP POST message; however, I am not sure how to pass the data to the opener. Can you guys provide some suggestions? Thanks. proxy_handler = urllib2.ProxyHandler({'http': 'http://my.proxy.com: 3128/'}) opener = urllib2.build_opener(proxy_handler) url

Re: logging outgoing HTTP POST message and incoming response message

2009-07-22 Thread scriptlear...@gmail.com
On Jul 22, 1:54 pm, Diez B. Roggisch de...@nospam.web.de wrote: You can use proxy-tools such as tcpmon or sniff traffic using wireshark. Diez Thanks, but I am trying to enable some debug mode to log all outgoing and incoming messages for certain period of time, and running another proxy-tool

regex: multiple matching for one string

2009-07-22 Thread scriptlear...@gmail.com
For example, I have a string #a=valuea;b=valueb;c=valuec;, and I will like to take out the values (valuea, valueb, and valuec). How do I do that in Python? The group method will only return the matched part. Thanks. p = re.compile('#a=*;b=*;c=*;') m = p.match(line) if m:

Looking for the right library for a simple HTTP client

2009-07-09 Thread scriptlear...@gmail.com
I am trying to implement a simple client that can do the following: 1)to send the following kinds of HTTP requests and validate responses 1.1 GET 1.2 POST with application/x-www-form-urlencoded encoding 1.3 POST with multipart/form-data encoding 2)to set any number of (even duplicate) headers.