аватар question@mail.ru · 01.01.1970 03:00

List in Txt File in Python

Actually how to write the result of the function of the function in the TXT file?

  f =  open  ( '***. txt' ,  'w' ) f.write ( '????'
аватар answer@mail.ru · 01.01.1970 03:00

There are several options:

  F.Write ( .join ( list ). Join ( "" \ n "" ));  

   for  item  in   line :  f.write ( "" % s \ n ""  item)  

   import  Pickle # a good option for non-String lists, because we will take a serialization   # using pickle. Can be serialized in json or, for example, xml.  pickle.dump (
                            

Latest

Similar