Python

From My Wiki
Jump to: navigation, search

Ran into some issue writing a thread downloader in python. Heres what I found.

Debuging in Python

sudo apt-get install gdb python2.7-dbg
gdb python <pid of running process>
bt
py-bt
thread apply all py-list

Exceptions

  • except: accepts all exceptions, whereas
  • except Exception as e:
  • exception Exception
  • differs from
  • exception OSError

More: https://docs.python.org/2/library/exceptions.html