Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. import shlex
  2.  
  3. def check_process(command, output):
  4. ok = False
  5. try:
  6. out = subprocess.check_output(shlex.split(command), stderr=subprocess.STDOUT, shell=False)
  7. if out.find(output) > -1:
  8. ok = True
  9. except BaseException as e:
  10. print(e.output)
  11. ok = False
  12. return ok
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement