def shellcmd(cmd, verbose=True):
 if verbose:
  print cmd
 try:
  subprocess.check_call(cmd, shell=True)
 except subprocess.CalledProcessError as err:
  msg = ('\n        Error while executing a shell command.\n        %s\n        ' % str(err))
  raise Exception(msg)

def shellcmd ( cmd , verbose = True ) : if verbose : print cmd try : subprocess . check_call ( cmd , shell = True ) except subprocess . CalledProcessError as err : msg = ( '\n        Error while executing a shell command.\n        %s\n        ' % str ( err ) ) raise Exception ( msg )
call a shell command .