import code
import sys
def keyboard(banner=None):
''' Function that mimics the matlab keyboard command '''
# use exception trick to pick up the current frame
try:
raise None
except:
frame = sys.exc_info()[2].tb_frame.f_back
print "# Use quit() to exit :) Happy debugging!"
# evaluate commands in current namespace
namespace = frame.f_globals.copy()
namespace.update(frame.f_locals)
try:
code.interact(banner=banner, local=namespace)
except SystemExit:
return
Coronavirus and Machine Learning Conferences
4 years ago