Following dlq_browse.py sample application, I was doing similar, but browsing XMITQ, and so needed to get XQH header from the message.
For DLH we can make it simple by using its get_header() method.
dlh = mq.DLH().get_header(msg)
For XQH samilar does not work, as the class does not provide such method.
A workaround is to it do it this way instead:
xqh = ibmmq.XQH()
xqh.unpack(msg[:104])