python 第三方包管理_Python 对Cisco交换机的管理第三方包Ciscolib

ciscolib是git上的一个开源的第三方python模块,用来管理Cisco交换机。目前只支持简单的telnet的管理。管理方法非常简单,模块的源码本身也不复杂。对日日常的批量配置比较有帮助。

模块结构为:

7a79ca5d81d75111f29404482500efb3.png

官方操作实例:

import ciscolib

switch = ciscolib.Device("hostname or ip", "login password", "optional login username")

switch.connect()    # Defaults to port 23

# There are some helper commands for common tasks

print(switch.get_model())

print(switch.get_ios_version())

print(switch.get_neighbors())

switch.enable("enable_password")

# Or you can throw plain commands at the switch

print(switch.cmd("show run"))

相关细节可以查看模块源码,相对比较简单。ciscolib实现了异常处理,在遭遇到异常的时候可以查看异常处理的源码,可以很好的帮助到脚本的调试。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Python第三方包是由第三方公司或团队开发的,可以极大地提升Python开发效率。可以通过使用pip命令来安装第三方包。 pip是Python的第三方包管理工具,可以帮助我们方便地安装、更新和卸载第三方包。 一些常用的Python第三方包包括ipython,它是一个强大的Python交互式shell,支持变量自动补全和自动缩进。可以使用pip命令安装ipython,例如:pip install ipython。 对于安装第三方包时可能遇到的网络问题,我们可以指定使用国内源来安装,比如使用清华大学的源:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple 包名。 如果需要删除已安装的包,可以使用pip uninstall 包名命令。如果需要安装特定版本的包,可以使用pip install 包名==版本号来指定安装。 总结来说,Python第三方包是由第三方公司或团队开发的,可以通过pip命令来安装、更新和卸载。常用的第三方包有ipython等,可以提升Python开发效率。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [【PythonPython 包 ③ ( Python 第三方包简介 | 安装第三方包 | 命令行安装 | PyCharm 安装 | 设置代理 |...](https://blog.csdn.net/han1202012/article/details/131489379)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *3* [Python中的第三方包](https://blog.csdn.net/m0_48978908/article/details/119812004)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值