以控制台友好且可读的方式格式化通过其结构指定的文档

RecursiveDocument的Python项目详细描述


不要使用这个库:它是为了支持InteractiveCommandLine, 而click库则要好得多。 我不会修复库中的任何内容,我正在将自己的项目迁移到click

recursivedocument是一个python(2.7+和3.3+)库格式,以控制台友好和可读的方式, 通过其结构(节、小节、段落等)指定的文件。 它特别适合打印命令行可执行文件的帮助消息。

它是根据MIT license授权的。 在Python package index上有售, 它的documentation is hosted by Python 它的源代码在GitHub上。

https://img.shields.io/travis/jacquev6/RecursiveDocument/master.svghttps://img.shields.io/coveralls/jacquev6/RecursiveDocument/master.svghttps://img.shields.io/codeclimate/github/jacquev6/RecursiveDocument.svghttps://img.shields.io/scrutinizer/g/jacquev6/RecursiveDocument.svghttps://img.shields.io/pypi/dm/RecursiveDocument.svghttps://img.shields.io/pypi/l/RecursiveDocument.svghttps://img.shields.io/pypi/v/RecursiveDocument.svghttps://img.shields.io/pypi/pyversions/RecursiveDocument.svghttps://img.shields.io/pypi/status/RecursiveDocument.svghttps://img.shields.io/github/issues/jacquev6/RecursiveDocument.svghttps://badge.waffle.io/jacquev6/RecursiveDocument.png?label=ready&title=readyhttps://img.shields.io/github/forks/jacquev6/RecursiveDocument.svghttps://img.shields.io/github/stars/jacquev6/RecursiveDocument.svg

快速启动

从pypi安装:

$ pip install RecursiveDocument

导入:

>>> from RecursiveDocument import *

创建文档:

>>> doc = Document().add(
...   Section("Introduction")
...     .add("This is the first paragraph of a very interesting story. It begins with this paragraph.")
...     .add("After the first paragraph comes the second paragraph. As incredible as it may sound, it can go on and on and on...")
... )

并打印出来:

>>> print doc.format()
Introduction
  This is the first paragraph of a very interesting story. It begins
  with this paragraph.
<BLANKLINE>
  After the first paragraph comes the second paragraph. As incredible
  as it may sound, it can go on and on and on...

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java将Map<String,String>传递给需要Map<String,Object>   java在循环中使用字符串而不是StringBuilder是否会造成内存损失?   jnlp如何更新java控制台JRE?   java更改、修改和重新打包CXFAPI源文件   JavaFXJava应用程序在Fedora上运行一段时间后关闭   使用来自不同类的方法的java   java如何通过ant脚本在linux中使用subst?   java在使用camunda modeler进行base64编码/解码时出错   获取java。netbeans、weblogic和fastswap设置为true时的lang.NoSuchMethodError   java如何提高FinalizerThread在GC中收集对象的优先级   java检测具有相同根的单词   netbeans crud应用程序中的java错误