打印所有内容!

pyprinter的Python项目详细描述


为所有人打印所有内容!

Latest VersionTravis CI build status
Project page:https://github.com/ofir123/py-printer

用法

python 3的完美打印机!

只需创建一个打印机实例,选择您喜欢的颜色并开始工作!
py打印机支持所有的ansi颜色和疯狂的编码!
它还计算控制台宽度,以便正确包装单词。

importpyprinterprinter=pyprinter.get_printer()# Write a simple line.printer.write_line(printer.YELLOW+'Hello World!')# Or use the color functions (nested coloring is also supported).printer.write_line(printer.yellow('Hello World!'))
docs/images/simple.png
# Use indentations.withprinter.group(indent=4):printer.write_line(printer.GREEN+'Hello Again!')
docs/images/indented.png
# Write aligned values.printer.write_aligned('Awesomeness','Check!')
docs/images/aligned.png
# Write titles.printer.write_title('Wow!')
docs/images/title.png
# Print human-readable file sizes.frompyprinterimportFileSizeFileSize(42352352).pretty_print()
docs/images/file_size.png
# Use tables.frompyprinterimportTableTable('Test',[{'1':'a','2':'b','3':'c'}]).pretty_print()
docs/images/table.png
# Integrate friendly progress bars.importtimefrompyprinterimportProgressBarprogress=ProgressBar(10)foriinrange(10):time.sleep(1)progress.eval(i)progress.finish()
docs/images/progress_bar.png
# Use word-wrapping or colors only.printer=pyprinter.get_printer(colors=False,width_limit=True)printer.write_line(printer.YELLOW+'Hello World!')
docs/images/no_colors.png

安装

pip install pyprinter

发展

要生成新版本,请执行以下操作:

  • Update version string in ^{tt2}$ (in both ^{tt3}$ and ^{tt4}$ fields)
  • Update version in ^{tt5}$ file.
  • Run ^{tt6}$ to create the build
  • Run ^{tt7}$ to upload everything to PyPi
  • Create a release (and tag) for the new version in GitHub (and delete the old one)
  • Delete old version from PyPi as well

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

推荐PyPI第三方库


热门话题
java Camera API如何聚焦图像中多边形的中心?   来自Java的spring Filling邮戳模板   java只能编织本地JAR的方面吗?   javajavax。加密。BadPaddingException:解密错误无法解密加密的公钥   从java运行ansibleplaybook   在Java中,如何从不同的偏移量读取大块的字符串文件?   java Android GridView将无法确定正确的位置   executorservice如何使用自动线程管理在Java中实现生产者/消费者   JavaEJB3.1嵌入式API单元测试EJB+JPA实体   API的java输出自动停止   java Checkmarx缺陷解决方案   java缓存,获取最早的元素   WebSphere8中的JavaEJB问题   两个时区之间的java Jodatime时差   Java 8不兼容类型错误   java TableCellEditor:如果按下该键,则清除原始文本;如果没有输入,则保留值