文章分类 -  python 脚本

摘要:1 #!/usr/bin/env python 2 3 4 import paramiko 5 6 hostname='192.168.4.5' 7 user='root' 8 password=123456 9 10 ssh = paramiko.SSHClient() 11 ssh.set_missing_host_key_policy(paramiko.AutoA... 阅读全文
posted @ 2018-03-23 17:09 hrwu 阅读(79) 评论(0) 推荐(0)
摘要:通过__import__()函数导入模块 dd = __import__('module_name') #相当于 import modulue_name as dd #反射:根据字符操作对象中的属性 通过getattr()函数获取模块里的函数 function = getattr('module_n 阅读全文
posted @ 2017-12-06 18:57 hrwu 阅读(206) 评论(0) 推荐(0)
摘要:步骤: 1.通过Element 创建根节点 2.通过SubElement 添加子节点 3.通过Element创建节点,再通过append,添加子节点到节点 4.通过ElementEtree生成xml文件对像,用来生成xml文件 阅读全文
posted @ 2017-11-26 15:29 hrwu 阅读(1515) 评论(0) 推荐(0)
摘要:python 解释xml 模块:xml.etree.Element 主要方法: <breakfast_menu> <food> <name>haha</name> <price>$5.95</price> <description> two of our famous Belgian Waffles 阅读全文
posted @ 2017-11-26 14:10 hrwu 阅读(134) 评论(0) 推荐(0)