regular expression

2011-08-16 Thread Danny Wong (dannwong)
Hi All, If I get multiline standard output from a command. How can I retrieve this part of the string (1006) Example: #Committing... #Workspace: (1003) My OS_8.12.0 Work - (1004) OS_8.12.0 # Component: (1005) he-Group - (1004) OS_8.12.0 #Outgoing: # Change sets: #(1006)

subprocess.Popen question

2011-08-16 Thread Danny Wong (dannwong)
Hi All, I'm executing a command which I want to capture the standard/stderr output into a file (which I have with the code below), but I also want the standard output to go into a variable so I can process the information for the next command. Any ideas? Thanks. CMD_OUTPUT =

RE: regular expression

2011-08-16 Thread Danny Wong (dannwong)
. Thanks again. -Original Message- From: ch...@rebertia.com [mailto:ch...@rebertia.com] On Behalf Of Chris Rebert Sent: Tuesday, August 16, 2011 12:26 AM To: Danny Wong (dannwong) Cc: python-list@python.org Subject: Re: regular expression On Tue, Aug 16, 2011 at 12:00 AM, Danny Wong

subprocess.Popen and thread module

2011-08-10 Thread Danny Wong (dannwong)
Hi All, I'm trying to execute some external commands from multiple database. I'm using threads and subprocess.Popen ( from docs, all the popen* functions are deprecated and I was told to use subprocess.Popen) to execute the external commands in parallel, but the commands seems to hang. My

RE: subprocess.Popen and thread module

2011-08-10 Thread Danny Wong (dannwong)
: print Error Executing %s % command + \n -Original Message- From: ch...@rebertia.com [mailto:ch...@rebertia.com] On Behalf Of Chris Rebert Sent: Tuesday, August 09, 2011 11:47 PM To: Danny Wong (dannwong) Cc: python-list@python.org Subject: Re: subprocess.Popen and thread module On Tue

RE: subprocess.Popen and thread module

2011-08-10 Thread Danny Wong (dannwong)
[mailto:ch...@rebertia.com] On Behalf Of Chris Rebert Sent: Tuesday, August 09, 2011 11:53 PM To: Danny Wong (dannwong) Cc: python-list@python.org Subject: Re: subprocess.Popen and thread module On Tue, Aug 9, 2011 at 11:38 PM, Danny Wong (dannwong) dannw...@cisco.com wrote: Hi All,   I'm trying

python module to determine if a machine is idle/free

2011-08-03 Thread Danny Wong (dannwong)
Hi all, I have 5 server machines that are using to process information. I would like to write a quick server python script that determines which of the machines are not in use. Any recommendations on which python module I should use to detect if a machine is not performing idle

Seeking an example on using Queue to update variable while threading

2011-07-27 Thread Danny Wong (dannwong)
Hi Python experts, I'm trying to use a dict structure to store and update information from X number of threads. How do I share this dict structure between threads? I heard of using a queue, but I'm not familiar with how it works. Does anyone have an example of using a queue to store