This package provides a simple way to initialize files.
Project description
※下の方に日本語の説明があります
English description
This package provides a simple way to initialize files. You no longer need to check if its directory exists before creating a file!!
How to use
from fileinit import fileinit
fileinit(
"./test.txt", # filename
overwrite = True,
init_str = "Hello, World!!\n"
)
Output result: test.txt
Hello, World!!
- If you omit the argument
init_str, the file will be initialized with empty string"". - If you set the argument
overwritetoFalseand if the file already exists, this package will not do anything.
日本語の説明
ファイルを簡単に初期化するためのパッケージです。 もうファイル作成の前にディレクトリの存在を確認する必要はありません!
簡単な使い方
from fileinit import fileinit
fileinit(
"./test.txt", # filename
overwrite = True,
init_str = "Hello, World!!\n"
)
出力結果: test.txt
Hello, World!!
- 引数
init_strを省略した場合、ファイルは空白文字列""で初期化されます。 - 引数
overwriteをFalseに設定すると、既に同名のファイルが存在する場合は新たなファイルは作成されません。
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
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 fileinit-0.0.2.tar.gz.
File metadata
- Download URL: fileinit-0.0.2.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03da849287d5394c5109eae35a4cd778b9b483bfa253e5d68ee1903b15fba3f8
|
|
| MD5 |
3fd62a3681a6c743906288f3b0569197
|
|
| BLAKE2b-256 |
e2a0d5587b1d41cadb92f690a02c9ca06b0e4618b09beb32d116b4c596c8b299
|
File details
Details for the file fileinit-0.0.2-py3-none-any.whl.
File metadata
- Download URL: fileinit-0.0.2-py3-none-any.whl
- Upload date:
- Size: 2.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e23c6e69110ef3a90fc3dff7928facea5cd02e72034e0a5172fbcbf5a4741ab
|
|
| MD5 |
950479a3302e7aaa159d78cc56b586e3
|
|
| BLAKE2b-256 |
dadd0b30f32e6b7770384aefae9c0864090972d3c5ffb13ae02a4b5146382845
|