Is there a Python equivalent to Perl's Data::Dumper for inspecting data structures?

前端 未结 11 1363
小鲜肉
小鲜肉 2020-12-10 00:19

Is there a Python module that can be used in the same way as Perl\'s Data::Dumper module?

Edit: Sorry, I should have been clearer. I was mainly afte

11条回答
  •  难免孤独
    2020-12-10 01:08

    Data::Dumper has two main uses: data persistence and debugging/inspecting objects. As far as I know, there isn't anything that's going to work exactly the same as Data::Dumper.

    I use pickle for data persistence.

    I use pprint to visually inspect my objects / debug.

提交回复
热议问题