Skip to content

Instantly share code, notes, and snippets.

@jarhill0
Created November 6, 2017 07:38
Show Gist options
  • Select an option

  • Save jarhill0/aeb137321ae5c2439e08aaf1e103c0a6 to your computer and use it in GitHub Desktop.

Select an option

Save jarhill0/aeb137321ae5c2439e08aaf1e103c0a6 to your computer and use it in GitHub Desktop.
import multiprocessing
import time
def execute(code):
if code == 'S':
time.sleep(15)
print('Finished executing "{}".'.format(code))
if __name__ == '__main__':
while True:
code = input('Enter code: ')
p = multiprocessing.Process(target=execute, args=(code,))
p.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment