* Break the code at runtime and get a python shell by putting on the line above: import pdb; pdb.set_trace() * Or even better: an ipython shell: import ipdb; ipdb.set_trace() * If there is no stdout or the program messes with it: Use rpdb or ripdb https://pypi.python.org/pypi/ripdb Example: import ripdb; ripdb.set_trace() SAVED_STTY=$(stty -g); stty -icanon -opost -echo -echoe -echok -echoctl -echoke; nc 127.0.0.1 4444; stty $SAVED_STTY * Beyond printf: from IPython.lib.pretty import pprint pprint(complex_object) # or from pprint import pprint pprint (vars(complex_object)) * To detect possible run-time errors without running the program check https://github.com/quora/pyanalyze pip3 install pyanalyze python3 -m pyanalyze file.py