From a7bed5fbbaa98a476aa6c112b6c8366efab4d359 Mon Sep 17 00:00:00 2001 From: topdogs Date: Wed, 1 Mar 2017 12:05:33 +0800 Subject: [PATCH] =?UTF-8?q?config.ini=E6=96=87=E4=BB=B6=E8=AF=BB=E5=8F=96?= =?UTF-8?q?=E7=9A=84=E7=9B=B8=E5=AF=B9=E5=9C=B0=E5=9D=80=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Py3Cache.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Py3Cache.py b/Py3Cache.py index 92791f5..cb370bb 100644 --- a/Py3Cache.py +++ b/Py3Cache.py @@ -3,7 +3,7 @@ """ Python Implements Level 2 Cache Broker """ - +import os import sys import json import uuid @@ -37,7 +37,8 @@ class Py3Cache (threading.Thread): threading.Thread.__init__(self) config = configparser.ConfigParser() config.optionxform = str # 保留配置文件key的大小写设定 - config.read("config.ini") + config_path=os.path.join(os.path.split(os.path.realpath(__file__))[0],"config.ini") + config.read(config_path) self.debug = "true" == config.get("global", "debug") -- Gitee