08 2018 档案
摘要:python下的目录操作: import os os.getcwd() #获取当前路劲 os.chdir(r’路径’) #进入某个目录下 f = open (‘test.txt’,’w’,encoding=’utf8’) #创建文件 os.makedirs(r’path\new_folder’) #
阅读全文
摘要:1.文件处理(i/o处理) 在python2里用file,在python3里用open w没有创建/有就覆盖 r 阅读 a 追加 创建文件 f = file(‘myfile.txt’,’w’) f = write(“hello world!”) f.close 遍历文件内容 a = file(‘us
阅读全文
浙公网安备 33010602011771号