来源:蜘蛛抓取(WebSpider)
时间:2017-01-18 18:46
标签:
巨人时代教育靠谱吗
& 文章列表页
资讯-用户中心Special column经常希望可以执行一个命令行N次。。。windows下没有现成的工具(有?推荐给我!)
用python写一个。。。
#!/usr/bin/evn python
#coding: utf-8
run a command line for n times
import sys
import string
if __name__ == &__main__&:
if len(sys.argv) &= 3:
n = int(sys.argv[1])
cmd = string.join(sys.argv[2:], ' ')
print '''error command line
times n &command line&
for x in range(n):
os.system(cmd)
C:\Users\hydon>times 10 echo hello world.
hello world.
hello world.
hello world.
hello world.
hello world.
hello world.
hello world.
hello world.
hello world.
hello world.
阅读(...) 评论()