first commit
This commit is contained in:
14
pyutils/configs.py
Normal file
14
pyutils/configs.py
Normal file
@@ -0,0 +1,14 @@
|
||||
import configparser
|
||||
|
||||
|
||||
def get_item(config_file_path, section, option):
|
||||
config = configparser.ConfigParser()
|
||||
config.read(config_file_path)
|
||||
return config.get(section, option)
|
||||
|
||||
def get_item_list(config_file_path, section, option):
|
||||
valye_list = get_item(config_file_path, section, option)
|
||||
valye_list = valye_list.split(',') if valye_list else []
|
||||
valye_list = [x for x in valye_list if x != '']
|
||||
return valye_list
|
||||
|
||||
Reference in New Issue
Block a user