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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file printopia-0.4.0.tar.gz.
File metadata
- Download URL: printopia-0.4.0.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.11.3 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34988f9d77234b4f34f8a04a3f8eef78de758124335d8ea089fabf10e936ec0c
|
|
| MD5 |
f0b678cd78e8999d5d3b425d5e6c0efe
|
|
| BLAKE2b-256 |
ac21b7e48a367a5b2c58e9b9ec09c25e4f71d3970381a4b101d0edc018376ecb
|
File details
Details for the file printopia-0.4.0-py3-none-any.whl.
File metadata
- Download URL: printopia-0.4.0-py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.11.3 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81cfc9e37d393b314b054a455cd178e210ebe679252c9d523affdef3843cb139
|
|
| MD5 |
720b82a521a06dd76528ef730bd0f370
|
|
| BLAKE2b-256 |
ce1accc839d988a24c86b8088a28209ead62fd82bdd81fc23f40a579192c5761
|