Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. class controlled_execution:
  2. def __enter__(self):
  3. set things up
  4. return thing
  5. def __exit__(self, type, value, traceback):
  6. tear things down
  7.  
  8. with controlled_execution() as thing:
  9. some code
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement