python Copy with open("sample.txt", 'r+') as f: f.truncate(4). 請注意,該檔案是以讀寫模式開啟的。上面的程式碼將樣本檔案的大小調整為4 位元組。
確定! 回上一頁