#Python脚本

This is an article that was created 860 days ago, and the information may have evolved or changed.

  • 针对上一版的脚本进行改进
  • 增加嵌套一层 ‘ Try……finally: ’ ,代码执行末尾提示 “按任意键退出”
  • 修改代码中预定义的登陆账号密码为 input 和 getpass 手动输入
  • 修改文件当前目录为代码自动获取 os.getcwd()
  • 修改执行完成后显示 “A log file is available in……” 记录log路径
  • 想改多线程,threading 模块逻辑没搞清楚

Read More

This is an article that was created 861 days ago, and the information may have evolved or changed.

  • Python 脚本 SSH 登陆华三设备,使用定义好的 display 脚本批量导出配置和一些设备状态
  • Python 脚本 SSH 登陆华三设备,使用定义好的配置命令批量增加配置
  • 主要使用的是 netmiko 这个模块里的 ConnectHandler 命令
  • 单线程
  • 脚本运行完成后输出 成功和失败的记录log
  • ip_list.txt,cmd_list.txt,cmd_config_list.txt 格式简单,修改方便
  • 未做多账号密码的 if 语句判断
  • 肯定有冗余繁重的代码

Read More

This is an article that was created 1069 days ago, and the information may have evolved or changed.

之前做了一个割接网络的项目,在过程中要测试网点和中心的几百条专线线路,心想要逐个 ping 测试个对端IP地址,在时间上,操作上根本不可行,整个割接时间有限定,又是在凌晨时间……限制比较多,刚好那段时间在玩 Python,就想着能不能做个脚本自己跑,最后实现了,而且生成 Excel 表格统计测试成功和测试失败的信息。

Read More

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×