Python | Toolbox

uploads/2016/12/python_1.jpeg

Introduction

Update Python Environment

Update all Python packages

<pre class="">pip3 list| cut -f1 -d' '|xargs -I {} pip3 install {} --upgrade

Debugging and Tracing

<pre class="">def tracefunc(frame, event, arg, indent=[0]):
      if event == "call":
          indent[0] += 2
          print "-" * indent[0] + "> call function", frame.f_code.co_name
      elif event == "return":
          print "<" + "-" * indent[0], "exit function", frame.f_code.co_name
          indent[0] -= 2
      return tracefunc

import sys
sys.settrace(tracefunc)

main()
The Latest