摘要:
import pickle """以前的文件写入,只能写入字符串,如果希望把任意数据对象(数字、列表等)写入文件, 取出来的时候数据类型不变,就用到pickle了 """ # shop_list = ["eggs", "apple", "peach"] # with open('/tmp/shop. 阅读全文
摘要:
import os os.getcwd() # 显示当前路径 os.listdir() # ls -a os.listdir('/tmp') # ls -a /tmp os.mkdir('/tmp/mydemo') # mkdir /tmp/mydemo os.chdir('/tmp/mydemo' 阅读全文