【发布时间】:2018-09-13 01:15:38
【问题描述】:
我正在尝试创建一个将用户输入写入文本文档的程序,但它不工作。
它只是一遍又一遍地循环这一节。这是我当前的代码:
else:
#Creates a new file and writes the pasword to it
print("Strong Password")
password1 += password1
newName = input("What do you want to save this password as? ")
print(newName)
file = open("passwordstorer", "w")
file.write(newName)
file.write(password1)
file.close()
break
【问题讨论】:
-
我们能看到更多你的代码吗?
-
欢迎来到 Stack Overflow!其他用户将您的问题标记为低质量和需要改进。我重新措辞/格式化您的输入,使其更容易阅读/理解。请查看我的更改以确保它们反映您的意图。但我认为你的问题仍然无法回答。 你现在应该edit你的问题,添加缺失的细节(见minimal reproducible example)。如果您对我有其他问题或反馈,请随时给我留言。