保存變量save的二進制快照的最佳方式是由sample以下的數據類型構成的? program save_it
type core
integer, dimension(8) :: indx
end type core
type sample
integer :: a
real*8, dimension(:), allocatab
我有8位數字的列表,如[255,8,16,254 ...]這些文件的數量約爲8000. 我有關於保存這些數字的問題,當我保存它時,它必須是8000字節,我是假的嗎? 但我有大約20kb。當我讀取它時,如何將這些數字保存爲8位,我想以字節讀取。 file = open(name,"wb")
for el in data:
file.write(bytes(el))
我的錯誤在哪裏?請