#!/usr/bin/python#-*-coding:utf-8-*-importtime,os,sys#获取输出需要备份的文件或者目录source_file=sys.argv[1]#通过os.path.isfile(source_file)函数来判断需要备份的是文件或目录state=os.path.isfile(source_file)printstate#如果是文件则执行以下代码ifstate==True:#获..
分类:
编程语言 时间:
2014-11-17 14:13:05
阅读次数:
155
#!/usr/bin/python
#-*-coding:utf-8-*-
importparamiko
importdatetime
importos,tab,sys
frommultiprocessingimportProcess,Pool
host_list=(
(‘192.168.1.127‘,‘root‘,‘123456‘),
(‘192.168.1.143‘,‘root‘,‘123456‘),
(‘192.168.1.141‘,‘root‘,‘123456‘),
)
defput(host_..
分类:
编程语言 时间:
2014-11-17 14:11:15
阅读次数:
225
#coding=utf-8import threading #导入threading包from time import sleepimport timedef task1(): print ("Task 1 executed." )sleep(1)def task2():print ("Task 2...
分类:
编程语言 时间:
2014-11-17 13:48:38
阅读次数:
204
1. Colorful Number:A numbercan be broken into different sub-sequence parts. Suppose a number 3245 can bebroken into parts like 3 2 4 5 32 24 45 324 24...
分类:
其他好文 时间:
2014-11-17 09:08:40
阅读次数:
401
Travelling
Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 4106 Accepted Submission(s): 1310
Problem Description
After coding so man...
分类:
其他好文 时间:
2014-11-16 18:48:18
阅读次数:
192
http://www.nowamagic.net/librarys/veda/detail/2408在 Zen And The Art Of Scaling - A Koan And Epigram Approach 一文中, Russell Sullivan 提出一个很有趣的设想:一共有20种经典...
分类:
其他好文 时间:
2014-11-15 18:30:26
阅读次数:
150
在过去的几年里,在互联网上出现了许多为开发人员提供的在线编程网站(Coding playgrounds)。这不是一件坏事情,毕竟,如果一个编程网站的话,开发者们迟早会腻的。在这些网站上,你在网页上编写代码,可以实时地看到效果。你可以编辑所有的东西并预览其效果。当然,这些网站最适合编写HTML,CSS...
分类:
Web程序 时间:
2014-11-15 18:27:04
阅读次数:
301
#-*- coding:utf-8 -*-
#!/usr/bin
'''
@author: 136354553
'''
def get_ip(number='10',start='2001:2:3:4:5:6:7:8'):
starts = start.split(':')
A = int(starts[0],16)
B = int(starts[1],...
分类:
其他好文 时间:
2014-11-15 15:34:19
阅读次数:
889
#-*-coding:utf-8-*-__author__='Administrator'fromPyQt4importQtCore,Qt,QtGuiimportsys,time,datetime,os,sched,psutil,wmifromtoolsimportUi_FormclassExToo...
分类:
其他好文 时间:
2014-11-15 12:38:34
阅读次数:
268
python中的函数使用较简单,这里列出值得注意的几点: 内嵌函数 例如: # coding: utf-8 def foo(): def bar(): print 'bar() called.' print 'foo() called.' foo()
bar() 对bar的调用是非法的,因为bar的...
分类:
编程语言 时间:
2014-11-14 22:25:50
阅读次数:
326