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 th
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.
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
My parent thread keeps a counter for the number of free child workers
(say 100) and initializes some child threads and call child.start().
Once the number of free child workers reach 0, the parent thread will
wait until some at least one child thread finishes and then it will
initialize another chi
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 =
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:
On Jul 22, 1:54 pm, "Diez B. Roggisch" 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 is not very idea
I am sending a HTTP POST by using the following codes:
opener = urllib2.build_opener(proxyHandler, MultipartPostHandler)
params = { "audio" : "http://sample.com/my.wav";,
"data" : open(file, "rb") }
print opener.open(myURL, params).read()
How do I log or print out the actual POST message (includi
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. Fo