https://github.com/wasasquatch/cstr
Provides a method for printing colored messages to console with preset tags.
https://github.com/wasasquatch/cstr
Last synced: over 1 year ago
JSON representation
Provides a method for printing colored messages to console with preset tags.
- Host: GitHub
- URL: https://github.com/wasasquatch/cstr
- Owner: WASasquatch
- License: mit
- Created: 2023-10-07T04:21:05.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-22T23:33:42.000Z (almost 3 years ago)
- Last Synced: 2025-03-25T02:40:01.040Z (over 1 year ago)
- Language: Python
- Size: 11.7 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cstr
Provides a method for printing colored messages to console with preset tags.
# Installation
`pip install https://github.com/WASasquatch/cstr.git`
# Example usage
```python
from cstr import *
p = cstr()
#! MESSAGE TEMPLATES
p.color.add_code("msg", f"{cstr.color.BLUE}MyProject: {cstr.color.END}")
p.color.add_code("warning", f"{cstr.color.BLUE}MyProject {cstr.color.LIGHTYELLOW}Warning: {cstr.color.END}")
p.color.add_code("error", f"{cstr.color.RED}MyProject {cstr.color.END}Error: {cstr.color.END}")
#! EXAMPLE USAGE
p("This is a message").msg.print()
p("This is a warning").warning.print()
p("This is a error").error.print()
#! JUST USE COLOR
print(f"{p.color.RED}Red text{p.color.END}")
```