python delete only files in dir_Linux DB2 Java Python PHP Code Snippets_百度空间
2012-02-27 10:40
786 查看
python delete only files in dir_Linux DB2 Java Python PHP Code Snippets_百度空间
python delete only files in dir2010-06-04 9:53
查看文章 |
try: for the_file in os.listdir(tmp_dir): file_path = os.path.join(tmp_dir, the_file) if os.path.isfile(file_path): os.unlink(file_path) os.rmdir(tmp_dir)#remove empty directory except Exception, e: pass print "can not delete %s with directory inside: %s"%(tmp_dir,e) |
相关文章推荐
- Linux delete define files in correct dir and sub-dir
- How to Delete HUGE (100-200GB) Files in Linux
- 不要在linux上使用java 7 Files的接口参数StandardOpenOption.DELETE_ON_CLOSE
- 三天半看完 C++(前置准备:Java、Python、JavaScript入门、Kotlin、PHP、Laravel、Linux、Nginx、ES5进阶、Gradle、Groovy)
- java、python、php、linux知识结构
- .NET/ASP.NET/C#/WCF/SQL Server/My SQL/Java/JSP/JDBC/Spring/Spring MVC/PHP/Python/Ruby/Shell/Agile/CSS/HTML/HTTP/Unix/Linux大量PDF书籍/电子书籍下载, Effective Java 下载
- linux 下搭建Nginx+php报错open_basedir restriction in effect. File(/var/www/html/index.php) is not within
- contenttype_仙乐_XianLe -- Java,DotNet,PHP,JavaScript,RSA,WSAD,DB2,Oracle,MySql,VE_百度空间
- one command to delete all files with name "filename" in current dir and all its sub-dirs
- rsync - find - perl - Which is the fastest method to delete files in Linux
- 脚本语言性能比较:Ruby,Io,PHP,Python,Lua,Java,Perl...
- Ant- Unable to locate tools.jar. Expected to find it in C:/Program Files/Java/jre
- Java programming problem in linux box: Exception in thread "main" java.lang.NoClassDefFoundError
- Install Oracle Java 8 (JDK8 and JRE8) in Ubuntu / Linux Mint
- 实现PHP,.NET, C#, JAVA, Python, Ruby,C(++) 与websocket 实时通信
- Java Run As Service in Linux
- Perl、PHP、Python、Java和Ruby的比较
- 分别使用Java,PHP,Python 进行web开发
- C、go、python、java、php和node.js 简单循环累加运算速度测试[测试demo仅供参考]