python first training

创建,删除,重命名文件在这里插入代码片 创建 #!/usr/bin/pyhon #--coding :utf-8-- file=open(‘D:/py/1.txt’,‘w’) file.write(‘hello,\n tomorrow’) 删除 import os path=‘D:/1.txt’ if os.path.exists(path): os.remove(path) else: prin
相关文章
相关标签/搜索