Skip to content

Instantly share code, notes, and snippets.

@justecorruptio
Created January 25, 2018 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justecorruptio/3e5d030b5b55b70ce1b2c1eded484740 to your computer and use it in GitHub Desktop.
Save justecorruptio/3e5d030b5b55b70ce1b2c1eded484740 to your computer and use it in GitHub Desktop.
inline debugger
import cProfile, logging, cStringIO, pstats
prof = cProfile.Profile()
score_list = prof.runcall(model.score, scoring_data)
prof.create_stats()
stream = cStringIO.StringIO()
stats = pstats.Stats(prof, stream=stream)
stats.strip_dirs().sort_stats('time').print_stats(20)
#print stream.getvalue()
logging.getLogger().info(stream.getvalue())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment