Archived
1
0
Fork 0
This repository has been archived on 2024-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
akari-bot/config/__init__.py
2021-02-01 23:13:11 +08:00

13 lines
288 B
Python

from configparser import ConfigParser
def config(path, q):
cp = ConfigParser()
cp.read(path)
section = cp.sections()[0]
value = cp.get(section, q)
if value.upper() == 'TRUE':
return True
if value.upper() == 'FALSE':
return False
return value