fork(1) download
  1. class Foo (object):
  2.  
  3. def __enter__ (self):
  4. print("Enter")
  5. return 1
  6.  
  7. def __exit__ (self, exit, value, exc):
  8. print("Exit")
  9.  
  10. with Foo() as foo:
  11. print(foo)
  12.  
Success #stdin #stdout 0.02s 28384KB
stdin
Standard input is empty
stdout
Enter
1
Exit