打印所有内容!
pyprinter的Python项目详细描述
为所有人打印所有内容!
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!'))
# Use indentations.withprinter.group(indent=4):printer.write_line(printer.GREEN+'Hello Again!')
# Write aligned values.printer.write_aligned('Awesomeness','Check!')
# Write titles.printer.write_title('Wow!')
# Print human-readable file sizes.frompyprinterimportFileSizeFileSize(42352352).pretty_print()
# Use tables.frompyprinterimportTableTable('Test',[{'1':'a','2':'b','3':'c'}]).pretty_print()
# Integrate friendly progress bars.importtimefrompyprinterimportProgressBarprogress=ProgressBar(10)foriinrange(10):time.sleep(1)progress.eval(i)progress.finish()
# Use word-wrapping or colors only.printer=pyprinter.get_printer(colors=False,width_limit=True)printer.write_line(printer.YELLOW+'Hello World!')
安装
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