蟒蛇纹优雅
pyprel的Python项目详细描述
pyprel
雅致的Python印花
设置
pip install pyprel
简介
此模块提供python呈现功能。它可以呈现 字典,以便显示缩进以供说明 等级:
sample information: name: ttH generator: pythia8 cross section: 0.055519 variables: zappo_n: 9001 trk_n: 147 number of events: 124883 k factor: 1.0201 ID: 169888
它可以渲染和显示徽标:
____ _ _____ _ / ___|___ | | ___ _ __| ___| | _____ __ | | / _ \| |/ _ \| '__| |_ | |/ _ \ \ /\ / / | |__| (_) | | (_) | | | _| | | (_) \ V V / \____\___/|_|\___/|_| |_| |_|\___/ \_/\_/
它可以将文本块居中,以便终端输出(例如 上面的标志)。它可以渲染段显示:
_ _ _ _ _ _ _ _ | | | _| _||_||_ |_ ||_||_| |_| ||_ _| | _||_| ||_| _|
它可以呈现和显示各种指定宽度和列的表 具有各种文字环绕功能和分隔符的宽度:
|---------------------------------------------------| |heading 1 |heading 2 | |---------------------------------------------------| |some text |some more text | |---------------------------------------------------| |lots and lots and lots |some more text | |and lots and lots of text| | |---------------------------------------------------|
|---------------------------| |heading 1 |heading 2 | |---------------------------| |some text |some more | | |text | |---------------------------| |lots and lots|some more | |and lots and |text | |lots and lots| | |of text | | |---------------------------|
||----------------------------------------------------|| ||heading 1 ||heading 2 || ||----------------------------------------------------|| ||some text ||some more text || ||----------------------------------------------------|| ||lots and lots and lots ||some more text || ||and lots and lots of text|| || ||----------------------------------------------------||
|-----------------------------------------------------------------------------| |heading 1 |heading 2 |heading 3 | |-----------------------------------------------------------------------------| |some text |some more text |even more text | |-----------------------------------------------------------------------------| |lots and lots and lots |some more text |some more text | |and lots and lots of text| | | |-----------------------------------------------------------------------------|
|---------------------------------------------------------------------------| |heading 1 |heading 2 |heading 3 |heading 4 | |---------------------------------------------------------------------------| |some text |some more text |even more text |yeah more text | |---------------------------------------------------------------------------| |lots and lots and |some more text |some more text |some more text | |lots and lots and | | | | |lots of text | | | | |---------------------------------------------------------------------------|
它可以提供调色板,扩展它们并保存它们的图像。 通过保存可用调色板的图像,可以查看它们:
pyprel.save_images_of_palettes()
调色板可以使用其名称加载:
pyprel.access_palette(name="palette1")
调色板可以扩展到所需的颜色数:
colors_1_extended=extend_palette(colors=colors_1,minimum_number_of_colors_needed=15)