Created
November 6, 2017 07:38
-
-
Save jarhill0/aeb137321ae5c2439e08aaf1e103c0a6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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