Open the file in binary mode, appending a b to the mode you want to use. with open("file.txt","wb") as f: f.write(b'foo\rbar').
確定! 回上一頁