Skip to content

Instantly share code, notes, and snippets.

def foo():
try:
if 1:
print('TRY')
return 1
print('AFTER RETURN')
except:
print('EXCEPT')
finally:
print('FINALLY')
# argparse module How to add option without any argument?
# https://stackoverflow.com/questions/5262702/argparse-module-how-to-add-option-without-any-argument
from argparse import ArgumentParser
p = ArgumentParser()
_ = p.add_argument('-f', '--foo', action='store_true')