Guest User

Untitled

a guest
Jan 18th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. # Other code goes here
  2. def run():
  3. pass
  4. # ...
  5.  
  6. def main():
  7. global nailgun
  8.  
  9. while True:
  10. try:
  11. nailgun = importlib.reload(nailgun)
  12. except ImportError as e:
  13. print("ImportError: {}".format(e))
  14. print("Hit enter to reload")
  15. input()
  16. continue
  17.  
  18. try:
  19. nailgun.run()
  20. except Exception as e:
  21. print(repr(e))
  22. print("Caught exception in run: {}".format(e))
  23. print("Hit enter to reload/rerun")
  24. input()
  25.  
  26.  
  27. if __name__ == "__main__":
  28. main()
Add Comment
Please, Sign In to add comment