Skip to content

Instantly share code, notes, and snippets.

View karolyi's full-sized avatar
🏠
Working from home

László Károlyi karolyi

🏠
Working from home
View GitHub Profile
@karolyi
karolyi / python-commandline-if-exception.py
Last active August 29, 2015 14:09
Open interactive shell to investigate when something throws an exception
try:
# this is what fails here
context['children'] = mark_safe(u''.join(parts))
except:
import code
import readline
import rlcompleter
vars = globals()
vars.update(locals())
readline.set_completer(rlcompleter.Completer(vars).complete)