import cPickle as p

f = file('data.txt' , 'w')

data = (1 , 'A' , "hello")

p.dump(data , f)                             # 将数据保存到本地文件中

f.close()



f = file('data.txt' , 'r')

data = p.load(f)                            # 加载本地文件的数据到data对象

f.close()

 

相关文章:

  • 2022-01-17
  • 2022-12-23
  • 2021-07-21
  • 2022-12-23
  • 2021-10-07
  • 2022-02-06
  • 2022-12-23
  • 2021-12-02
猜你喜欢
  • 2022-12-23
  • 2021-10-07
  • 2021-08-18
  • 2021-08-31
  • 2022-12-23
  • 2021-09-14
  • 2021-08-11
相关资源
相似解决方案