mirror of
https://github.com/LC044/WeChatMsg
synced 2025-02-23 11:35:20 +08:00
通过环境变量获取用户路径
This commit is contained in:
parent
c713c591bd
commit
f492beaf44
@ -22,9 +22,9 @@ def get_abs_path(path):
|
|||||||
|
|
||||||
def wx_path():
|
def wx_path():
|
||||||
## 获取当前用户名
|
## 获取当前用户名
|
||||||
users = os.path.expandvars('$HOMEPATH')
|
user_home = os.environ.get("USERPROFILE")
|
||||||
## 找到3ebffe94.ini配置文件
|
## 找到3ebffe94.ini配置文件
|
||||||
f = open(r'C:' + users + '\\AppData\\Roaming\\Tencent\\WeChat\\All Users\\config\\3ebffe94.ini', encoding='utf-8')
|
f = open(user_home + '\\AppData\\Roaming\\Tencent\\WeChat\\All Users\\config\\3ebffe94.ini', encoding='utf-8')
|
||||||
txt = f.read()
|
txt = f.read()
|
||||||
f.close()
|
f.close()
|
||||||
# 打开Windows注册表
|
# 打开Windows注册表
|
||||||
|
Loading…
Reference in New Issue
Block a user