while True:
x = raw_input()
if x =="personal information":
print' Edward , Height: 5,10 , EYES: brown , STATE: IL TOWN: , SS:'
elif x =="journal":
name_of_file = raw_input("What is the name of the file: ")
completeName = "C:\\python\\" + name_of_file + ".txt"
file1 = open(completeName , "w")
toFile = raw_input("Write what you want into the field")
file1.write(toFile)
file1.close()
else:
break
腳本不斷給我一個錯誤說break是在循環之外是縮進錯誤?休息是在循環外python
你必須解決您的壓痕 – 2012-07-30 22:14:55
還你會發現同樣的錯誤,你可能會後悔沒有把**開(completeName,「W」)**的事***嘗試/ catch OSError *** ...特別是,如果'completeName'是根據用戶輸入計算的...(只是說')***:)*** – BorrajaX 2012-07-30 22:19:43