Skip to main content

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")
First argument: File Name
Second argument: mode (Write : w ,Read : r ,Delete : d)
Third argument: section name ([] in)
Fourth argument: option name (left of “=”)
Fifth argument: value (to the right of “=”)

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")
The return value is the read result.

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)

Click here for details (Japanese)

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

editini-1.0.4.tar.gz (3.0 kB view details)

Uploaded Source

File details

Details for the file editini-1.0.4.tar.gz.

File metadata

  • Download URL: editini-1.0.4.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.7

File hashes

Hashes for editini-1.0.4.tar.gz
Algorithm Hash digest
SHA256 59a4ecc920c46e9c27df1238bda04e15e40eecf70f9038e9e0dfa353b618fb5d
MD5 9d55112b6ae61a15a7c75356efc3e038
BLAKE2b-256 3b682ac1bda98c384e52b1ddd0e24f036fabf8fff9ea030d091b582940d1cd6e

See more details on using hashes here.

Supported by

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