Skip to main content

Output path management tool for results (images, etc.) of numerical experiments, etc.

Project description

resout

This description is under construction.

概要

Output path management tool for results (images, etc.) of numerical experiments, etc. 数値実験等の結果(画像等)の出力パス管理ツール

基本的な使い方

import resout

# 保存ファイル名の生成(自動で連番になる) [resout]
filename = resout.gen_save_path(".txt", label = "exp_result")
with open(filename, "w", encoding = "utf-8") as f:
	f.write("hoge")

上記のように、gen_save_path()関数を使用することで連番のファイル名を取得できる

連番の説明

import resout

print(resout.gen_save_path(".txt", "exp_result"))	# -> <path>\output_img\20210605T144210\exp_result_0.txt
print(resout.gen_save_path(".txt", "exp_result"))	# -> <path>\output_img\20210605T144210\exp_result_1.txt
print(resout.gen_save_path(".txt", "exp_result"))	# -> <path>\output_img\20210605T144210\exp_result_2.txt

画像を保存する

import resout
import numpy as np

img = np.zeros((200,200,3), dtype = np.uint8)
# 画像の保存 [resout]
resout.save_img(img, ratio = 1.0, ext = ".png", label = "resout_img")

保存パスの変更

import resout

# 保存パスの設定 [resout]
resout.set_save_dir("./results/")

# 保存ファイル名の生成(自動で連番になる) [resout]
filename = resout.gen_save_path(".txt", label = "exp_result")
with open(filename, "w", encoding = "utf-8") as f:
	f.write("hoge")

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

resout-0.0.5.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

resout-0.0.5-py3-none-any.whl (3.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page