Skip to main content

用于 Python 3.6+ 的语法突出显示更漂亮的打印机

项目描述

Prettier_Printer:用于 Python 3.6+ 的语法突出显示更漂亮的打印机

该库旨在尽可能简单直观地打印更漂亮的 Python 代码。

教程

漂亮打印常见的 Python 值:

>>> from prettier_printer import pprint
>>> d = {
...    'example_tuple': (1, 2, 3, 4),
...    'word': 'Python is an interpreted programming language.',
...    'example dict': {'set': set([1, 2, 3, 4])}
...}
>>> pprint(d, depth=10, indent=2, width=12, sort_dict_keys=True)

{
  'example dict': {
    'set': {1, 2, 3, 4}
  },
  'example_tuple': (1, 2, 3, 4),
  'word': (
    'Python is an ',
    'interpreted ',
    'programming ',
    'language.'
  )
}

漂亮地打印带有语法突出显示的常见 Python 值:

https://farm8.staticflickr.com/7803/40459058903_0469f24702_b.jpg

安装

$ pipenv install prettier_printer

仅支持Python 3.6

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

内置分布

prettier_printer-0.1.4-py3-none-any.whl (4.4 kB 查看哈希)

已上传 py3