https://github.com/ysy9997/ProcessingTools.git
Project description
ProcessionTools
- You can install this package using pip.
pip install processingtools
ProgressBar
import processingtools as pt
import time
for i in pt.ProgressBar(range(50)):
time.sleep(0.1)
or
import processingtools as pt
import time
for i in pt.ProgressBar(range(50), bar_length=40, start_mark=None, finish_mark='progress done!', total=False):
time.sleep(0.1)
Then,
|████████████████████████████████████████| 100.0% | 50/50 | 0s |
progress finished!(5311ms)
parameters
class pt.ProgressBar(in_loop, bar_length: int = 40, start_mark: str = None, finish_mark='progress done!', total: int = None, detail_func: callable = None)
- in_loop: the input loop
- bar_length: bar length
- start_mark: print string when the progress start
- finish_mark: print string what you want when progress finish
- total: total value. If you do not fill this, it will calculate automatically, but it may be slow
- detail_func: write detail using detail_func
- remove_last: If True, remove last progressbar
EnvRecoder
import processingtools as pt
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--save_path', type=str)
args = parser.parse_args()
recoder = pt.EnvReco('/save/path')
args = recoder.arg2abs(args)
recoder.record_arg(args)
recoder.record_code()
recoder.record_os()
recoder.record_gpu()
recoder.put_space()
recoder.print('record logs')
Then, record information in the log file
Args:
{
save_path: None
}
OS Env:
{
ALLUSERSPROFILE: ...
APPDATA: ...
COMMONPROGRAMFILES: ...
⋮
}
GPU Info:
{
cuda: True
num: 1
names: ['...']
}
[2023-7-3 19:50:9.78]: record logs
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
processingtools-0.3.13.tar.gz
(19.4 kB
view hashes)
Built Distribution
Close
Hashes for processingtools-0.3.13-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5189ae12285a1ec2225a99977d2c49566369998ce6b23cb85765c1a7d98e7dae |
|
MD5 | f28332aebe673a86855e6ff629a45db0 |
|
BLAKE2b-256 | 39555d928a5acb8330e5987249314999ae14edbb40976d28a14bd0977f650c23 |