It is easy to write and read .ini. Click here for details (Japanese) http://penguin0093.html.xdomain.jp/page/project/project.html
Project description
This was created because the author found it difficult to use “configparser”. “edit ini” is partially compatible with “configparser”. You can create, edit and delete “[section]” and “option = value” for files with “.ini” extension. 日本語版はこちらです
License
Copyright (c) 2020 Penguin0093 Released under the MIT license https://opensource.org/licenses/mit-license.php
How to use it.
The basic style is:
iniio.iopen("File name","Open mode","section","option","value")
1.Import
from editini Import iniio
2.Writing
Code
iniio.iopen("config.ini","w","section","option","value")
Result config.ini
[section] option = value
If the “value” is empty, “” (empty character) is substituted
3.Reading
iniio.iopen(" .ini","r","section","option")
config.ini
[section] option = value
Code
print(iniio.iopen("config.ini","r","section","option")+"\n")
print(iniio.iopen("config.ini","r","section")+"\n")
print(iniio.iopen("config.ini","r")+"\n")
Result
value option = value [section] option = value
4.Delete
iniio.iopen(" .ini","d","section","option")
config.ini
[section] option = value
Code #1
iniio.iopen("config.ini","d","section","option")
Result #1 config.ini
[section]
Code #2
iniio.iopen("config.ini","d","section")
Result #2 config.ini
(Empty)
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
File details
Details for the file editini-1.0.3.tar.gz.
File metadata
- Download URL: editini-1.0.3.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba9369c4d69681dc9cb6d332b05dfe09eb928774621b2232e3fb390660349168
|
|
| MD5 |
3d5b836ea3cc6c4d30c661d90622ab52
|
|
| BLAKE2b-256 |
7286c10867d32af1c756b01e11478a7a347678537f28f7a7bdb638f624edc203
|