undefined->使用python内置函数获取系统盘符
This commit is contained in:
parent
d605c89fed
commit
70b0c6792f
|
@ -59,19 +59,15 @@ try:
|
|||
sys.stdout.write("\033[0m\033[?25h\n\n\n")
|
||||
|
||||
# 搜索磁盘和用户名
|
||||
sysdrive = "X:"
|
||||
if not os.path.exists(sysdrive+"\\"):
|
||||
sysdrive = "C:"
|
||||
sysdrive = os.getenv("SystemDrive")
|
||||
username = "Default"
|
||||
for i in os.listdir(f"{sysdrive}\\Users"):
|
||||
if i not in ("Default", "Default User", "Public", "All Users") and not os.path.isfile(f"{sysdrive}\\Users\\{i}"):
|
||||
username = i
|
||||
|
||||
# 等待
|
||||
while 1:
|
||||
while not os.path.exists(f"{sysdrive}\\Users\\{username}\\Desktop"):
|
||||
time.sleep(1)
|
||||
if os.path.exists(f"{sysdrive}\\Users\\{username}\\Desktop"):
|
||||
break
|
||||
|
||||
# 加载
|
||||
log.info("load action \"onload\"")
|
||||
|
|
Loading…
Reference in New Issue