1 Star 2 Fork 0

凡凡世界 / script

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
add_hosts2.py 730 Bytes
一键复制 编辑 原始数据 按行查看 历史
凡凡世界 提交于 2014-03-07 08:51 . add add_hosts.py and add_host2.py
#-*-coding: utf-8 -*-
#/usr/bin/python
import ssh5
def add_member(member_name):
host = raw_input("host: ")
port = raw_input("port: ")
username = raw_input("username: ")
password = raw_input("password: ")
cmd = raw_input("command: ")
dict2 = {"host": host, "username": username, "port": port, "password": password, "cmd": cmd}
ssh5.ssh5(dict2["host"], int(dict2["port"]), dict2["username"], dict2["password"], dict2["cmd"])
dict_count = 0
while True:
dict_count = dict_count + 1
member = "dict" + str(dict_count)
print member
add_member(member)
status = raw_input("type any key for continue, type 'quit' for exit: ")
if status == "quit":
print "Bye..."
break
Python
1
https://gitee.com/fanfan/script.git
git@gitee.com:fanfan/script.git
fanfan
script
script
master

搜索帮助