每天一点python——删除文件
2015-11-14 11:10
537 查看
因为在运行一个服务的时候要删除RUNNING_PID,所以自己想用python删除避免了自己手动删除
使用的模块os
函数是:os.remove()
使用的模块os
函数是:os.remove()
#coding=utf-8 #用来删除指定文件 import os #print os.getcwd() try: os.remove('D:/adservice2/adservice2-1.0-SNAPSHOT/bin/RUNNING_PID') print 'good' except WindowsError: #pass print 'can not remove or not exit'
相关文章推荐
- python深入(函数,文件操作)
- Python正则表达式
- Python之旅(二)
- Python编写微信打飞机小游戏(七)
- 第三篇 python进阶 二
- PYTHON之路DAY3
- Python 基础内容 三
- Python字典分别按键值排序
- struct打包模块加强版!支持任意长度字符串解包
- python 中的unicode详解
- python实现mysql的单引号字符串过滤方法
- shutil.move的目标文件夹不存在
- Python脚本:清理桌面
- Python核心编程读笔 8: 文件和输入输出
- Python核心编程读笔 7: 条件和循环
- Python学习笔记004_字典_集合
- python笔记-lambda函数、sorted函数、map函数
- 输入密码或用户名判断是否正确
- Python 学习中遇到的各种问题
- 扑克程序 Python