My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import subprocess

def runcmd(cmd):
try:
f = subprocess.Popen(cmd,shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
stdout = f.stdout.read();
stderr = f.stderr.read();

if f.stdout.close() == None and f.stderr.close() == None:
return True,stdout,stderr
else:
return False,stdout,stderr
except OSError,x:
return False,x

Change log

r42 by djjordaan on Nov 12, 2009   Diff
[No log message]
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 391 bytes, 15 lines
Powered by Google Project Hosting