Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
コードはこんな感じ
with open(pickle_f, 'r') as fhand: obj = pickle.load(fhand)
これは Linux システムでは正常に機能しますが、Windows では機能しません。その表示EOFError。Windowsで動作させるにはモードを使用する必要がありrbます..これはLinuxでは動作しません。
rb
なぜこれが起こっているのですか、どうすれば修正できますか?
bpickleを読み書きするときは常にモードを使用します (open(f, 'wb')書き込みopen(f, 'rb')用、読み取り用)。既に持っているファイルを「修正」するには、dos2unix.
b
open(f, 'wb')
open(f, 'rb')
dos2unix