标签:port code 文件 imp col int datetime dict class
import shelve,datetime data = shelve.open("shelve_txt")###打开文件 dar_dict = {"name":"caicai","age":22} dar_list = ["a","b","c"] ##往文件写 data["dar_dict"] = dar_dict data["dar_list"] = dar_list data["dar_time"] = datetime.datetime.now() data.close()
import shelve,datetime data = shelve.open("shelve_txt")###打开文件 ##读取文件 a =data.get("dar_list") b=data.get("dar_dict") c =data.get("datetime") print(a,b,c) data.close()
标签:port code 文件 imp col int datetime dict class
原文地址:https://www.cnblogs.com/ArtisticMonk/p/8954489.html