count = 0
answer = ""
pass_pool={"CSRP":"","pos":"","erp":"","comverse":"","miki":"","citrix":""}
name = ""
def program_start():
answer = input('Do you want to make some TXT with the same passwords? y\\n :')
count = int(input('How many TXT files do you want to make?'))
name = input('Enter the hot user id:')
name = name+".TXT"
password_collector() # collect password to pass_pool dictionary
create_file() #create TXT file. it has to be in capital "TXT"
#for the safe program.
def create_file():
newTXT = open(name, "w")
newTXT.write(name + "\n \n" )
for system , password in pass_pool.items():
newTXT.write(system + ":" + password )
newTXT.close()
我得到:
File "C:\Python33\mypy\txt creator.py", line 16, in create_file
newTXT = open(name, "w")
FileNotFoundError: [Errno 2] No such file or directory:
从我在谷歌上看到的这个错误意味着找不到错误的路径或文件。但是我检查并在我的路径中sys.path
看到了这一点,并且我使用它创建了文件,因此它应该可以正常工作。"C:\Python33\mypy"
"w"
当我只使用create_file()
shell 中的函数时,它可以正常工作。