Add your description here
Project description
minwei_tools
This tools contain two major function
- Dotter : Display animated text on screen during long missions
- re_result : A Rust-like approach to error handling
Install
pip install minwei_tools
Usage
-
Dotter
from minwei_tools import Dotter, piano, slash from time import sleep with Dotter(cycle = piano, message="Loading", delay=0.1, show_timer=1) as d: sleep(120)
Also support an
asyncdotterfrom time import sleep import asyncio from minwei_tools import AsyncDotter async def main(): async with AsyncDotter("Thinking", show_timer=True, delay=0.1): await asyncio.sleep(120) asyncio.run(main())
-
rs_result
from minwei_tools.rs_result import Result, Ok, Err def devide(a: int, b: int) -> Result[int, str]: if b == 0: return Err("Division by zero error") return Ok(a // b) """ >>> result : Result[int, str] = devide(10, 0) >>> result.is_ok() False >>> result.is_err() >>> result : Result[int, str] = devide(10, 2) >>> result.is_ok() True >>> result.unwrap() 5 """ result : Result[int, str] = devide(10, 0) match result: case Ok(value): print(f"Result: {value}") case Err(value): print(f"Error: {value}") result : Result[int, str] = devide(10, 2) match result: case Ok(value): print(f"Result: {value}") case Err(value): print(f"Error: {value}")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
minwei_tools-0.1.5.tar.gz
(6.0 kB
view details)
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 minwei_tools-0.1.5.tar.gz.
File metadata
- Download URL: minwei_tools-0.1.5.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20e438ec7a6a96ef6c1c30ad5d0c09797bae53debd16ee33647a509ccb31631a
|
|
| MD5 |
e0258671bbb49f0c3b5d67257fbfa4c0
|
|
| BLAKE2b-256 |
9da23de5855e02b6388746005b1a8e1ad582a5c37e48742076ebfe7402694245
|
File details
Details for the file minwei_tools-0.1.5-py3-none-any.whl.
File metadata
- Download URL: minwei_tools-0.1.5-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b41fffbfb691af6f41d29c130a17193a86a1f8f151bbbd8177fdea78725f78a
|
|
| MD5 |
22592be88eb45df912df79a9e600a708
|
|
| BLAKE2b-256 |
e089dee2a58901e7db9067dc5b57e231bc35c3c27a37738d6739c6da75976b94
|