python 報錯:ValueError: I/O operation on closed file

這是python讀寫文件常常會遇到的錯誤python 報錯緣由:with open(filename)as f:f變量只在該代碼塊內有效,使用完後會自動關閉I/O流it 解決辦法:從新定義一個 open(fillename)變量或者從新使用with as語句變量
相關文章
相關標籤/搜索