我知道还有其他类似的问题,但都没有帮助。以下是完整代码:
save_path = r'C:\Program Files (x86)\Mod Tool\Infractions\Kicks'
name_of_file = whoisit
completeName = os.path.join(save_path, name_of_file + ".txt")
file1 = open(completeName, "w")
file1.write("Username: " + whoisit + " // "+ whatisit + " // Reason: " + reason)
file1.close()
print("Infraction stored.")
print("")
print("/kick" + ":" + whoisit + ":" + reason)
print("")
start()
为了让您通过,save_path是我希望它保存在的文件夹(txt将保存在Kicks文件夹中)
我认为你需要在windows中以管理员身份运行才能写入程序文件。 尝试以管理员身份运行。在
通常:右键单击->以管理员身份运行。在
相关问题 更多 >
编程相关推荐