Welcome, guest | Sign In | My Account | Store | Cart
'''shellcmd - simple invocation of shell commands from Python'''

def shell_call(cmd, *args, **kwds):
    if args or kwds:
        cmd = cmd.format(*args, **kwds)
    return subprocess.call(cmd, shell=True)

def check_shell_call(cmd, *args, **kwds):
    if args or kwds:
        cmd = cmd.format(*args, **kwds)
    return subprocess.check_call(cmd, shell=True)

def check_shell_output(cmd, *args, **kwds):
    if args or kwds:
        cmd = cmd.format(*args, **kwds)
    return subprocess.check_output(cmd, shell=True)

Diff to Previous Revision

--- revision 2 2011-10-21 05:52:48
+++ revision 3 2011-10-21 06:44:35
@@ -1,16 +1,16 @@
 '''shellcmd - simple invocation of shell commands from Python'''
 
-def call(cmd, *args, **kwds):
+def shell_call(cmd, *args, **kwds):
     if args or kwds:
         cmd = cmd.format(*args, **kwds)
     return subprocess.call(cmd, shell=True)
 
-def check_call(cmd, *args, **kwds):
+def check_shell_call(cmd, *args, **kwds):
     if args or kwds:
         cmd = cmd.format(*args, **kwds)
     return subprocess.check_call(cmd, shell=True)
 
-def check_output(cmd, *args, **kwds):
+def check_shell_output(cmd, *args, **kwds):
     if args or kwds:
         cmd = cmd.format(*args, **kwds)
     return subprocess.check_output(cmd, shell=True)

History