No project description provided
Project description
Introduction
This code provides functions to print colored messages in the console, as well as decorators to print the return values and arguments of a function.
Usage
Functions
The print_colored, print_error, print_log, and print_success functions all take the same arguments:
- *args: the arguments to be printed.
- color: the color in which to print the text (default: white).
- sep: the separator to be used between the arguments (default: " ").
- end: the character to be used at the end of the printed text (default: "\n").
Example usage:
print_colored("This text is white.")
print_error("This text is red.")
print_log("This text is yellow.")
print_success("This text is green.")
Decorators
The print_return and print_return_info decorators can be used to print the return value and/or arguments of a function.
Example usage:
@print_return
def add_numbers(x, y):
return x + y
add_numbers(2, 3)
## Output:
# 5 <- add_numbers
@print_return_info
def multiply_numbers(x, y):
return x * y
multiply_numbers(2, 3)
## Output:
# 6 <- multiply_numbers(2, 3)
Dependencies
colorama = "^0.4.6"
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
printopia-0.4.0.tar.gz
(2.3 kB
view hashes)
Built Distribution
Close
Hashes for printopia-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81cfc9e37d393b314b054a455cd178e210ebe679252c9d523affdef3843cb139 |
|
MD5 | 720b82a521a06dd76528ef730bd0f370 |
|
BLAKE2b-256 | ce1accc839d988a24c86b8088a28209ead62fd82bdd81fc23f40a579192c5761 |