cjkformat-0.1.1
توضیحات
This Python 3 module provides utility functions for formatting fixed-width CJK strings.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | cjkformat-0.1.1 |
| نام | cjkformat |
| نسخه کتابخانه | 0.1.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Huidae Cho |
| ایمیل نویسنده | grass4u@gmail.com |
| آدرس صفحه اصلی | https://github.com/HuidaeCho/cjkformat |
| آدرس اینترنتی | https://pypi.org/project/cjkformat/ |
| مجوز | - |
# CJK Format
This Python 3 module provides utility functions for formatting fixed-width CJK strings. One of the most important features of tihs module is to align Latin and CJK characters using `%{width}s` specifiers. For example, the following lines
```python
print('%-10s|%-10s|' % ('ab', 'cd'))
print('%-10s|%-10s|' % ('가나다라', '마바사아'))
```
will print misaligned lines between Latin and CJK characters even with the `%-10s` specifiers.
Now, using this module's `f()` function, the above example would be
```python
from cjkformat import f
print(f('%-10s|%-10s|', 'ab', 'cd'))
print(f('%-10s|%-10s|', '가나다라', '마바사아'))
```
which will print nicely aligned output.
The module also defines a shortcut function `printf()` to minic the same function in the C language. For example,
```python
from cjkformat import printf
printf('%-10s|%-10s|\n', 'ab', 'cd')
printf('%-10s|%-10s|\n', '가나다라', '마바사아')
```
For more information, please visit [the GitHub repository](https://github.com/HuidaeCho/cjkformat).
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3 | Python |
نحوه نصب
نصب پکیج whl cjkformat-0.1.1:
pip install cjkformat-0.1.1.whl
نصب پکیج tar.gz cjkformat-0.1.1:
pip install cjkformat-0.1.1.tar.gz