小白一只,使用VS2017+IronPython進行學習,寫了一個很簡單的打開并讀取文本檔案的幾行代碼,就是無法打開檔案,錯誤定位在第2行,錯誤資訊是:TypeError: expected file, got int
fs = open(r"E:\TempFile\L2020_1219.log","r",-1)
fstring=fs.read(-1)
print fstring
作業系統是win10 x64,檔案確定存在,且使用os.access檢查對檔案有讀寫權限。請問這到底是什么原因導致的?
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/240205.html
上一篇:萌新,爬蟲代碼遇到AttributeError求大神'NoneType' object has no attribute 'text'
