SystemVerilog Struct To Python Script

In reply to desperadorocks:
If you wrote

$fdisplay(fd, "p_d: %p",p_d);

You get:

p_d: '{a:3, s:"lion", sst:'{c:-20, b:6, p:"panther"}}

If you want any other kind of formatting, you need introspection. And you only get introspection by using the C-based VPI.