-1
我想知道如何創建一個.text文件,這樣我就可以在其中輸入文字,然後在我的程序中打開文件。我只需要知道如何製作一個.text文件!如何在終端中創建一個.text文件python3.33
任何人都知道爲什麼我的代碼在我嘗試運行時無法打開我的.txt文件?
def readWords(filename):
words = []
wordFile = open(words.txt, "r")
for line in wordFile:
line = line.upper()
words.extend(string.split(line))
wordFile.close()
return words
不要在您的舊帖子中編輯新的/不同的問題,因爲它會破壞問題現有答案的上下文。你應該創建一個新的問題。 – wim