删除工程中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
相关文档:
Python基本安装:
* http://www.python.org/ 官方标准Python开发包和支持环境,同时也是Python的官方网站;
* http://www.activestate.com/ 集成多个有用插件的强大非官方版本,特别是针对Windows环境有不少改进;
Python文档:
* http://www.pyth ......
Ctrl+3 行注释
Ctr+\ 去行注释
Ctrl+Shift+3 去行注释
Ctrl+4 块注释
Ctrl+5 & ......
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 ......
def delVss(path)
if File.directory?(path)
for f in d = Dir.open(path)
fpath = File.join(path, f)
if(f!="."&&f!="..")
......
什么是pyc文件
pyc是一种二进制文件,是由py文件经过编译后,生成的文件,是一种byte code,py文件变成pyc文件后,加载的速度有所提高,而且pyc是一种跨平台的字节码,是由python的虚拟机来执行的,这个是类似于JAVA或者.NET的虚拟机的概念。pyc的内容,是跟python的版本相关的,不同版本编译后的pyc文件是不同的,2 ......