import os
file = os.path.dirname(os.path.abspath(__file__))
cf = configparser.ConfigParser()
print(file)
cf.read(file+'/data.ini')
先获取绝对路径在读取
import os
file = os.path.dirname(os.path.abspath(__file__))
cf = configparser.ConfigParser()
print(file)
cf.read(file+'/data.ini')
先获取绝对路径在读取