https://github.com/aidinhamedi/python-color-print
a simple way to print colored text to the console.
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.3%) to scientific vocabulary
Repository
a simple way to print colored text to the console.
Basic Info
- Host: GitHub
- Owner: AidinHamedi
- License: mit
- Language: Python
- Default Branch: main
- Size: 13.7 KB
Statistics
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
Python-color-print
Function Signature
python
def print_Color(Input: str, colors: list, print_END: str = '\n', advanced_mode: bool = False):
Parameters
Input(str): The input string to be printed. In advanced mode, '~*' is used to separate different parts of the string to be printed in different colors.colors(list): A list of colors for the text. In non-advanced mode, only the first color in the list is used. In advanced mode, each color corresponds to a part of the input string separated by '~*'.print_END(str): The string appended after the final output, default is '\n'.advanced_mode(bool): If True, enables advanced mode that allows multiple colors in one string. Default is False.
Usage
In normal mode, you can print a string in a single color. For example:
python
print_Color('Hello, World!', ['green'])
This will print 'Hello, World!' in green.
In advanced mode, you can print different parts of a string in different colors. For example:
python
print_Color('~*Hello in green~*Hello in red', ['green', 'red'], advanced_mode=True)
This will print 'Hello in green' in green and 'Hello in red' in red.
Special Characters
The '~*' characters are used as separators for different parts of the string that need to be printed in different colors when using advanced mode.
Supported Colors
you can use the key word like 'black' and... to set the text color.
~~~ 'black': '\x1b[0;30m', 'red': '\x1b[0;31m', 'green': '\x1b[0;32m', 'yellow': '\x1b[0;33m', 'blue': '\x1b[0;34m', 'magenta': '\x1b[0;35m', 'cyan': '\x1b[0;36m', 'white': '\x1b[0;37m', 'normal': '\x1b[0m', 'bgblack': '\x1b[40m', 'bgred': '\x1b[41m', 'bggreen': '\x1b[42m', 'bgyellow': '\x1b[43m', 'bgblue': '\x1b[44m', 'bgmagenta': '\x1b[45m', 'bgcyan': '\x1b[46m', 'bgwhite': '\x1b[47m', 'bgnormal': '\x1b[49m', 'lightgray': '\x1b[0;90m', 'lightred': '\x1b[0;91m', 'lightgreen': '\x1b[0;92m', 'lightyellow': '\x1b[0;93m', 'lightblue': '\x1b[0;94m', 'lightmagenta': '\x1b[0;95m', 'lightcyan': '\x1b[0;96m', 'lightwhite': '\x1b[0;97m', 'bglightgray': '\x1b[0;100m', 'bglightred': '\x1b[0;101m', 'bglightgreen': '\x1b[0;102m', 'bglightyellow': '\x1b[0;103m', 'bglightblue': '\x1b[0;104m', 'bglightmagenta': '\x1b[0;105m', 'bglightcyan': '\x1b[0;106m', 'bglight_white': '\x1b[0;107m', 'underline': '\x1b[4m', 'bold': '\x1b[1m', 'blink': '\x1b[5m' ~~~
Owner
- Name: Aidin
- Login: AidinHamedi
- Kind: user
- Repositories: 1
- Profile: https://github.com/AidinHamedi
Segmentation fault
GitHub Events
Total
Last Year
Issues and Pull Requests
Last synced: about 1 year ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0