I\'d just like to exit out of a with statement under certain conditions:
with
with open(path) as f: print \'before condition\' if
Use while True:
while True
while True: with open(path) as f: print 'before condition' if : break print 'after condition n' break