https://docs.python.org/3/library/pprint.html
If you need the text (for using with curses for example):
import pprint
myObject = []
myText = pprint.pformat(myObject)
Then myText
variable will something alike php var_dump
or print_r
. Check the documentation for more options, arguments.