quickly open file

with open('C:\Python27\Testing\Fetch.txt') as f:
    for line in f:
        line = line.strip()
        dssh = paramiko.SSHClient()
        dssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
        dssh.connect(line, username='cisco', password='cisco')
        stdin, stdout, stderr = dssh.exec_command('sh ip ssh')
        mystring = stdout.read()
        print mystring
        f = open('C:\Python27\Testing\output.txt', 'a+')
        f.write(mystring)
        f.close()
Copyright © opschina.org 2017 with zzlyzq@gmail.com all right reserved,powered by Gitbook该文件修订时间: 2017-07-11 11:32:48

results matching ""

    No results matching ""