易截截图软件、单文件、免安装、纯绿色、仅160KB

删除工程中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资源

 Python基本安装:
    * http://www.python.org/ 官方标准Python开发包和支持环境,同时也是Python的官方网站;
    * http://www.activestate.com/ 集成多个有用插件的强大非官方版本,特别是针对Windows环境有不少改进;
Python文档:
    * http://www.pyth ......

python 3.0与python 2.x的区别

 正在阅读最新版的《A byte of Python》。发现Python3.0在某些地方还是有些改变的。准备慢慢的体会,与老版本的《A byte of Python》做对比,最后再去查阅官方网站的文档。
1.
如果你下载的是最新版的Python,就会发现所有书中的Hello World例子将不再正确。
Old:
print "Hello World!" #打印字符串
New:
......

python快捷键汇集


Ctrl+3            行注释
Ctr+\               去行注释
Ctrl+Shift+3   去行注释
Ctrl+4            块注释
Ctrl+5         & ......

RUBY EXCEL操作

 用ruby新建一个excel文件,并且设置一些值。
 require 'win32ole'
excel = WIN32OLE.new("excel.application")       
excel.Visible = true
excel.WorkBooks.Open("d:\\test.xls")
excel.WorkSheets("sheet1").Activate
excel.Cells(2,3).value = "张三"
exce ......

用python的cmd模块写一个简单的shell

 from cmd import *
class MyShell(Cmd):
    def preloop(self):
        print "print this line before entering the loop"
            
    def postloop(self):
&nb ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号