可以在任何操作系统上使用Unicode符号!
python-figures的Python项目详细描述
Python图
?Can use unicode symbols on any OS!
这个项目基于sindresorhus/figures。
安装
pip install python-figures
用法
您可以在this code或windows上看到支持的符号。您还可以在example.py
fromfiguresimportFigures,figuresasffigures=Figures()print(figures.get('tick'))figures.add('santa','??')print(figures.get('santa'))print(figures.get('nonexistent',default=''))print(figures.string('✔ ✔ ✔'))# ✔ ✔ ✔ or √ √ √# or you can use just like thisprint(f('tick'))print(f(string='✔ ✔ ✔'))# ✔ ✔ ✔ or √ √ √
API
图
添加(键,默认值,Windows)
可以使用此函数添加自定义符号。
键
类型:String
Unicode符号的键
默认值
类型:String
Unicode符号(如)
窗口
类型:String
如果输入此参数,则在windows cmd上返回unicode符号
获取(键,默认值)
用键返回操作系统友好的Unicode符号
键
类型:String
Unicode符号,请参见Figures。也可以将自定义符号与add函数一起使用
默认值
类型:String
在不存在的密钥参数时返回此。
字符串(字符串)
替换windows cmd的字符串。
字符串
类型:String
字符串有unicode符号的内容
全部获取()
获取所有符号,包括自定义符号
获取密钥()
获取符号的所有键,包括自定义符号
数字(键=无,字符串=无,默认值=无)
返回操作系统友好的带键的Unicode符号,或替换Windows CMD的字符串。
键
类型:String
Unicode符号,请参见Figures。
字符串
类型:String
字符串有Unicode符号的内容。
默认值
类型:String
在不存在的密钥参数时返回此。
图
Key | Default | Windows |
---|---|---|
tick | ✔ | √ |
cross | ✖ | × |
star | ★ | * |
square | ▇ | █ |
squareSmall | ◻ | [ ] |
squareSmallFilled | ◼ | [█] |
play | ▶ | ► |
circle | ◯ | ( ) |
circleFilled | ◉ | (*) |
circleDotted | ◌ | ( ) |
circleDouble | ◎ | ( ) |
circleCircle | ⓞ | (○) |
circleCross | ⓧ | (×) |
circlePipe | Ⓘ | (│) |
circleQuestionMark | ?⃝ | (?) |
bullet | ● | * |
dot | ․ | . |
line | ─ | ─ |
ellipsis | … | ... |
pointer | ❯ | > |
pointerSmall | › | » |
info | ℹ | i |
warning | ⚠ | ‼ |
hamburger | ☰ | ≡ |
smiley | ㋡ | ☺ |
mustache | ෴ | ┌─┐ |
heart | ♥ | ♥ |
arrowUp | ↑ | ↑ |
arrowDown | ↓ | ↓ |
arrowLeft | ← | ← |
arrowRight | → | → |
radioOn | ◉ | (*) |
radioOff | ◯ | ( ) |
checkboxOn | ☒ | [×] |
checkboxOff | ☐ | [ ] |
checkboxCircleOn | ⓧ | (×) |
checkboxCircleOff | Ⓘ | ( ) |
questionMarkPrefix | ?⃝ | ? |