獲取文件爲什麼我得到錯誤脅迫到Unicode:需要字符串或緩衝區,詮釋發現從用戶
file = input("Please enter the data file you wish to open: ")
獲取搜索值從用戶
value = int(input("Input a number to search for: "))
打開文件
datlist = open(file, "rb")
閱讀文件中的行
FileNums = datlist.read().splitlines()
關閉文件
datlist.close()
請複製粘貼您在運行上述腳本時得到的確切錯誤消息。在*我*機器上,我無法獲得您在問題中暗示的錯誤信息。 –
如果你可以標記答案,如果它幫助你解決你的問題,那將是很好的。 – jbaiter