console-color-0.1.0
توضیحات
print with color on the console.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | Unix |
| نام فایل | console-color-0.1.0 |
| نام | console-color |
| نسخه کتابخانه | 0.1.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Carson |
| ایمیل نویسنده | jackparadise520a@gmail.com |
| آدرس صفحه اصلی | https://github.com/CarsonSlovoka/console-color/tree/master |
| آدرس اینترنتی | https://pypi.org/project/console-color/ |
| مجوز | BSD 3-Clause |
==================
Console Color
==================
**print with color on the console.**
Install
============
``pip install console-color``
Features
============
- It allows you to register your own styles.
- Supports fore, background, style (Bold, Italic, URL, ...), and you can do **permutations**, really flexible.
- Well documented, you can find all the usage form `test.py`_ folder and `console_color.ipynb`_
.. note:: Github page may not show ipynb well, you can go `here <https://colab.research.google.com/drive/1cAYcC6DyiMCyD0RDcEo25LDFCh527TUQ?usp=sharing>`_ to see another resource that I put on Google Colab
Usage
------
.. code-block:: python
from console_color import *
# cprint(text, fg=, bg=, style=)
cprint('...', RGB.WHITE, '#ff0000', Style.BOLD + Style.URL)
cprint('...', (255, 0, 0), RGB.YELLOW, Style.BOLD + Style.URL)
# you can do permutations, for example, you only need style only then
cprint('...', style=Style.BOLD)
# combine with normal text
print('123' + cprint('...', '#ff0000', pf=False) + '~~~')
.. note:: get more help; please reference the `test.py`_ and `console_color.ipynb`_
Demo
==========
`★Click me <https://carsonslovoka.github.io/console-color/demo/console_color.html>`_ to see the HTML which is converted from ipynb
.. image:: https://raw.githubusercontent.com/CarsonSlovoka/console-color/release/doc/_static/nav_bar.logo.png
Contributing
===============
If you want to contribute, please use the ``release`` branch as the stable branch. ``dev`` is the future branch for the maintainer.
Be sure to **write tests** for new features. If you have any difficulties, you can ask me or discuss with me. I am glad if you want to join us.
By the way, I'm very friendly! (You can ask me questions with Chinese)
Useful Reference
==================
The below link may help you to understand how do you write, such as this library by yourself.
- `★ ANSI_escape_code <https://en.wikipedia.org/wiki/ANSI_escape_code>`_
- `stackoverflow: how to print colored text in terminal in python <https://stackoverflow.com/questions/287871/how-to-print-colored-text-in-terminal-in-python>`_
More
===========
See the `documentation <https://carsonslovoka.github.io/console-color/>`_
.. _test.py: https://github.com/CarsonSlovoka/console-color/blob/release/console_color/test/test.py
.. _console_color.ipynb: https://github.com/CarsonSlovoka/console-color/blob/release/console_color/demo/console_color.ipynb
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6.2, | Python |
نحوه نصب
نصب پکیج whl console-color-0.1.0:
pip install console-color-0.1.0.whl
نصب پکیج tar.gz console-color-0.1.0:
pip install console-color-0.1.0.tar.gz