formatist-0.0.2
توضیحات
Converts %-style format strings to newer {}-style
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | formatist-0.0.2 |
| نام | formatist |
| نسخه کتابخانه | 0.0.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Glyph |
| ایمیل نویسنده | glyph@twistedmatrix.com |
| آدرس صفحه اصلی | https://github.com/moreati/formatist |
| آدرس اینترنتی | https://pypi.org/project/formatist/ |
| مجوز | MIT |
formatist
=========
.. image:: https://travis-ci.org/moreati/formatist.svg?branch=master
:target: https://travis-ci.org/moreati/formatist
A Python library to convert from older `%` style format strings, to newer
`{}` style.
.. code:: python
>>> import formatist
>>> greeting = "Hello %(name)s. It's %(temp).1f C"
>>> print(greeting % {'name': 'Alice', 'temp': 23.45678})
Hello Alice. It's 23.5 C
>>> greeting2 = formatist.convert(greeting)
>>> print(greeting2)
Hello {name!s:}. It's {temp:>.1f} C
>>> print(greeting2.format(name='Alice', temp=23.45678))
Hello Alice. It's 23.5 C
نحوه نصب
نصب پکیج whl formatist-0.0.2:
pip install formatist-0.0.2.whl
نصب پکیج tar.gz formatist-0.0.2:
pip install formatist-0.0.2.tar.gz