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.1.0.tar.gz
(2.3 kB
view hashes)
Built Distribution
Close
Hashes for printopia-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68ca5ef88591d126d7d790404a8d3d69bb395978464fb8e6b9b100909c47ff3f |
|
MD5 | f438057a6a5ac6a93cca32cefe91ba23 |
|
BLAKE2b-256 | 05e09bfa11c029cba27ca7b32501ca3077f40f1e2919cf0bdb705b195145bf5b |