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.3.0.tar.gz
(2.3 kB
view hashes)
Built Distribution
Close
Hashes for printopia-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0b8bd44cd1dc61a88cb7f68bbff5895793d7306722a0bfefbad67bfe20bc7ba |
|
MD5 | 80cb68c41ddb0f6a09fe5a1e24dd5e2a |
|
BLAKE2b-256 | a6d304c9f4b2924d1775401eb21888a7f9ec48e407ac950b6a57ac09c697822f |