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.11.tar.gz
(18.2 kB
view hashes)
Built Distribution
Close
Hashes for processingtools-0.3.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9df01b3c959e717b517397e6a0c55f51e8cf13b647d99d2fd8b2a0116685b2e5 |
|
MD5 | 0eb522eeec1e40a83e9d02391ea8e31d |
|
BLAKE2b-256 | 52f6bf8e90e3b3f98946004b6e284c7cf1a1a71e999ab63df2f81fafcb6afe01 |