day23

import configparser

#配置对象

config = configparser.ConfigParser()
config.read('/Users/tophan/PycharmProjects/ATM+ 购物车/conf/setting.ini')#如果不是绝对路径,在其他地方调用该settings时,找不到setting.ini路径

BASE_PATH = config.get('section1', 'BASE_PATH')
print(BASE_PATH) #/Users/tophan/PycharmProjects/ATM+ 购物车

DB_PATH = config.get('section1', 'DB_PATH')
print(DB_PATH) #/Users/tophan/PycharmProjects/ATM+ 购物车/db

上一篇:js day23 动画 ajax 跨域请求


下一篇:day23