打印所有内容!

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是否存在这样一种场景:Java7的Hashmap实现优于Java8的实现   java如何打印这些完整的数组?   java BuildException:未能执行aapt   java如何使用类。未知类型的集合返回的cast()   java准备语句返回错误的值   webview 安卓中的java显示身份验证对话框   java如何重命名列名JPA Hibernate   java查询从特定用户和特定时间段的Oracle表(通过比较原始表和备份表)中选择修改的行   java Youtube视频仅在三星S6设备上加载时自动暂停   未调用java RecyclerView getItemViewType   使用JSch setCommand执行带有源选项的java Shell ping命令时失败   java Hibernate:无法删除|删除分离的实例   Java Spring@MappedSuperclass字段作为子类中的@Id字段   java Android:确定单击了哪个按钮,因为该按钮未在xml中定义   如何计算java阵列内存使用率   使用Java查找按字母顺序排列的第一个字符串   javascript注销功能刷新页面,但页面仍已登录   当接口作为参数提供时,java依赖项注入不起作用   java中带原语的字符串扭曲