How to drop into REPL (Read, Eval, Print, Loop) from Python code July 18, 2022 by Tarik I frequently use this: def interact(): import code code.InteractiveConsole(locals=globals()).interact()