1 .
2 . , [1-157]. . , , . . . , ( ). , . , . , , . , . . . . , , . ( ). , . . . . ,
>>> f=open("data.txt","w")
>>> f.write(" ")
>>> f.close()
>>>
data.txt " ". data.txt, .
>>> f=open("data.txt")
>>> f.read()
' '
>>>
data.txt , . , . , , [2]. b, , . . .
>>> f=open("data.txt","wb")
>>> f.write(" ")
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
f.write(" ")
TypeError: a bytes-like object is required, not 'str'
>>>
C , , , [2]. pickle, import. , pickle, :
>>> import pickle
>>> L=[23,2.3,' .',4+6j]
>>> f=open("Lst_dt.dt","wb")#
>>> pickle.dump(L,f) # L Lst_dt.dt
>>> f.close()
>>> f=open("Lst_dt.dt","rb")#
>>> pickle.load(f)# Lst_dt.dt
[23, 2.3, ' .', (4+6j)]
>>>