删除工程中svn文件的脚本(Ruby版和Python版)
两种不同的语言,不同的表达!
Python脚本实现.
""
"
File Name : clean.py
File Date : 2009/11/5 14:22:56
Author : DannyLai
Purpose : Clean the svn files
All svn projects have an hide directory "
.
svn"
The python script purpose is to clean the .svn directory in svn projects.
"
""
import
os
import
stat
SVNPROJECT_DIR =
"F:\\temp\\google-gdata"
def
findSVNDir(
path )
:
for
file in
os.
listdir(
path )
:
subpath =
os.
path.
join(
path,
file )
if
os.
path.
isdir(
subpath )
:
if
file =
=
".svn"
:
print
subpath
deleteSVNDir(
subpath )
else
:
findSVNDir(
subpath )
def
deleteSVNDir(
path )
:
for
file in
os.
listdir(
path )
:
subpath =
os.
path.
join(
path,
file )
if
os.
path.
isdir(
subpath
相关文档:
#!/usr/bin/env python
# -*-coding:UTF-8-*-#这一句告诉python用UTF-8编码
#=========================================================================
#
# NAME: Python MySQL test
#
# AUTHOR: benyur
# DATE : 2004-12-28
#
# COMMENT: 这是一个python连接mysql的例子
#
#================ ......
Python基本安装:
* http://www.python.org/ 官方标准Python开发包和支持环境,同时也是Python的官方网站;
* http://www.activestate.com/ 集成多个有用插件的强大非官方版本,特别是针对Windows环境有不少改进;
Python文档:
* http://www.pyth ......
import this
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough t ......
python提供了有序(sequence)类型(字符串,元组,列表都是有序类型),并且提供了特殊的语法来方便对这些类型进行操作,最常用的有切片操作。同一有序类型的对象之间支持”+”操作符,用来连成一个新的有序对象,有序对象也可以与一个整数进行相乘,得到一个新的有序对象。在调试的时候,我经常使用这样 ......