发布时间:2013-12-18 21:33:47
system返回值为0表示成功,否则表示失败import osprint os.system("ls")>> print os.system("ls")aaaa.tar mysql.txt untitled.py0......【阅读全文】
发布时间:2013-12-18 21:26:57
import osfor key in os.environ.keys(): print key,'\t',os.environ[key]......【阅读全文】
发布时间:2013-11-26 17:31:06
import os,sys,datetimeimport paramikofrom optparse import OptionParserdef cpFileSingleIp(sfile,dfile,ip): username = "root" password = "123456" port = 22 t=paramiko.Transport((ip,port)) t.connect(username=username,passwor.........【阅读全文】
发布时间:2013-11-26 17:28:59
#!/usr/bin/env pythonimport paramikoimport osimport sys#host = sys.argv[1]#print hostuser='root'password='123456'port=22cmd='df -h'hosts=['192.168.1.234', '192.168.1.101', ]s=paramiko.SSHClient()s.load_system_host_keys()s.set_missing_host_.........【阅读全文】
发布时间:2013-11-26 17:27:23
import osimport sysimport datetimeimport paramikousername='root'password='123456'port=22ip_list=['192.168.1.234', '192.168.1.101' ]local_file='/data/python/zhongwen.py'remote_file='/data/testdir/zhongwen.py'for ip .........【阅读全文】