cecream是一个Python库,可通过最少的代码使打印调试更具可读性 Rename:冰淇淋 github:https://github.com/gruns/icecream.git

image.png

Env

pip3 install icecream
from icecream import ic

Source Code

  1. # -*- coding: utf-8 -*-
  2. #
  3. # IceCream - Never use print() to debug again
  4. #
  5. # Ansgar Grunseid
  6. # grunseid.com
  7. # grunseid@gmail.com
  8. #
  9. # License: MIT
  10. #
  11. from os.path import dirname, join as pjoin
  12. from .icecream import * # noqa
  13. from .builtins import install, uninstall
  14. # Import all variables in __version__.py without explicit imports.
  15. meta = {}
  16. with open(pjoin(dirname(__file__), '__version__.py')) as f:
  17. exec(f.read(), meta)
  18. globals().update(dict((k, v) for k, v in meta.items() if k not in globals()))

How to Use?

image.png


Github:https://github.com/gruns/icecream.git Offic Web:https://www.cnpython.com/pypi/icecream