Skip to content

Instantly share code, notes, and snippets.

Created September 12, 2016 13:43
Show Gist options
  • Save anonymous/6eb2a7ddb062449ad671339867547f6e to your computer and use it in GitHub Desktop.
Save anonymous/6eb2a7ddb062449ad671339867547f6e to your computer and use it in GitHub Desktop.
import subprocess
def sendfail():
print('Sending email')
def main():
try:
subprocess.check_call(["python", "test.py"])
print('Success!')
except subprocess.CalledProcessError:
sendfail()
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment