二、应用实例解析
2.1 subprocess模块的使用
1. subprocess.call
>>> subprocess.call(["ls", "-l"])
0
>>> subprocess.call("exit 1", shell=True)
1
2. 调用系统中cmd命令,显示命令执行的结果:
x=subprocess.check_outpu...
分类:
编程语言 时间:
2014-09-09 12:36:58
阅读次数:
309
if(@ARGV!=2){
die "Usage: $0 sample_file sample_number\n";
}
my($sample_file, $sample_number) = @ARGV;
open my $FILE, "
my @content = ;
my $all_number = @content;
#print "|$all_number|\n";...
分类:
其他好文 时间:
2014-09-09 12:33:48
阅读次数:
351
Given n, generate all structurally unique BST's (binary search trees) that store values 1...n.
For example,
Given n = 3, your program should return all 5 unique BST's shown below.
1 3...
分类:
其他好文 时间:
2014-09-09 12:31:39
阅读次数:
143
火狐中文网图片效果:[http://i.firefoxchina.cn/?www.firefoxchina.cn].news-img-wrapper:hover img {transform: rotate(5deg) scale(1.2);transition: all 0.3s linear 3...
分类:
Web程序 时间:
2014-09-09 12:24:38
阅读次数:
179
You should do it in a single SQL statement if at all possible. And believe it or not, it is almost always possible.If you can’t do it in a single SQL ...
分类:
移动开发 时间:
2014-09-09 12:16:38
阅读次数:
262
数据库模式(schema)是数据结构的逻辑容器,被称作模式对象(schema objects)每一个数据库用户拥有一个和用户名相同的模式,例如hr用户拥有hr模式。在一个产品数据库中,模式的拥有者通常是数据库应用程序而不是一个人。在一个模式中,每一个模式对象都有一个唯一的名字。如hr.employe...
分类:
数据库 时间:
2014-09-09 12:13:08
阅读次数:
243
#-*-coding:utf-8-*-#python:2.x__author__='Administrator'#TK实现一个秒表效果#目的:是为了简单学习下TKfromtimeimport*fromTkinterimport*classStopWatch(Frame):mesc=50def__in...
分类:
编程语言 时间:
2014-09-09 11:48:48
阅读次数:
551
最近在学习Python,发现Python的模块真是不错 推荐使用WingIDE 在Vim模式下Tab键设置 Preferences->Keyboard->Tab Key Action = Insert Tab Character ~~~~~~~~~~~~~~~~~~~~~~~~~华丽的分割线~~~~...
分类:
编程语言 时间:
2014-09-09 11:41:48
阅读次数:
220
Python(x,y)是一款很好的Python2科学计算的集成开发环境但是Spyder,IPython感觉用起来总没有Winge 101来得流畅而且Python3的出现,众多模块也具备了3的相对应版本之前在Python3下开启pylab画图等模式时,总会出现许多问题所以,总结了一下import nu...
分类:
编程语言 时间:
2014-09-09 11:33:48
阅读次数:
368
1.the using of exception2.file oprationimport os>>> try: data = open('sketch.txt') for each in data: try: (role,message) = eac...
分类:
编程语言 时间:
2014-09-09 11:28:28
阅读次数:
189