会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
小菜鸟起飞ing
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
下一页
2023年2月17日
textfsm
摘要: from concurrent.futures import ThreadPoolExecutorimport netmikoimport osfrom threading import Lockimport pandas as pdfrom textfsm import TextFSMimport
阅读全文
posted @ 2023-02-17 10:15 小菜鸟起飞ing
阅读(102)
评论(0)
推荐(0)
2023年1月15日
netmiko批量操作网络设备
摘要: import pandas as pdfrom concurrent.futures import ThreadPoolExecutorimport netmikoimport osfrom threading import Lockclass net_dev(): def __init__(sel
阅读全文
posted @ 2023-01-15 14:15 小菜鸟起飞ing
阅读(232)
评论(0)
推荐(0)
2022年11月27日
python算数运算符
摘要: Python支持的所有基本算术运算符; 加法运算符: 示例: 1 a = 10 2 b = 96 3 sum1 = a+b 4 5 x = 3.14 6 y = 5.34 7 sum2 = x+y 8 9 print("sum1 = %d,sum2 = %.2f" % (sum1,sum2)) 结果
阅读全文
posted @ 2022-11-27 13:11 小菜鸟起飞ing
阅读(391)
评论(0)
推荐(0)
2022年11月23日
格式化字符串
摘要: 格式化字符串是什么? 1.使用占位符格式化字符串: 占位符: 例子: 占位符%s、%c、%%的使用: 占位符%d、%o、%x的使用: 占位符 %f、%e的使用: 2.使用format方法格式化输出: 1.不设置指定位置: 2.设置指定名称: 3.设置指定位置 : 格式化字符串是什么?Python字符
阅读全文
posted @ 2022-11-23 19:00 小菜鸟起飞ing
阅读(683)
评论(0)
推荐(0)
2022年11月15日
批量创建xshell会话
摘要: import re import os import openpyxl from openpyxl import Workbook,workbook from concurrent.futures import ThreadPoolExecutor import time class xshell_
阅读全文
posted @ 2022-11-15 20:48 小菜鸟起飞ing
阅读(1239)
评论(0)
推荐(0)
2022年11月14日
netmiko批量操作华为设备
摘要: from concurrent.futures import ThreadPoolExecutorimport timeimport netmikoimport osfrom threading import Lockimport openpyxlclass net_dev(): def __ini
阅读全文
posted @ 2022-11-14 22:02 小菜鸟起飞ing
阅读(406)
评论(0)
推荐(0)
2022年1月10日
python_异常处理(try except)
摘要: 1,异常捕获 异常捕获的字段为python解释报错的最后一行的第一个单词。使用try方法,程序报错时,可以使用except方法匹配报错的异常关键字,继续except下方定义的代码,从而保证代码可以正常运行,保证代码的稳定性。 # 定义一个计算器 def compute(): num = int(in
阅读全文
posted @ 2022-01-10 23:06 小菜鸟起飞ing
阅读(741)
评论(0)
推荐(0)
2022年1月7日
python_子网划分计算器
摘要: import ipaddress class Compute: def __init__(self, network): self.net = network # 功能1: ip子网划分 def ip(self): with open ("可用ip地址.txt","w") as tmp_file:
阅读全文
posted @ 2022-01-07 14:49 小菜鸟起飞ing
阅读(777)
评论(0)
推荐(0)
python_类 对象 属性
摘要: 1, 类 (class) 类的概念表示某种对象的集合,用于表示某一种相同对象的模板。例如:人作为一个类 由这个“人”类定义出来的内容就是这个类定义出来的对象,类还拥有属性和功能,属性即类本身的一些特性,如人类有名字、身高和体重等属性,而具体值则会根据每个人的不同;功能则是类所能实现的行为,如人类拥有
阅读全文
posted @ 2022-01-07 10:51 小菜鸟起飞ing
阅读(295)
评论(0)
推荐(0)
2022年1月4日
python_文件操作
摘要: open函数 文件的操作流程: #1. 打开文件,得到文件句柄并赋值给一个变量 #2. 通过句柄对文件进行操作 #3. 关闭文件 (一定要关闭文件,否则会一直占用系统资源,并且有安全隐患) 实例: f = open("txt-test", "r", encoding="utf-8") """ txt
阅读全文
posted @ 2022-01-04 11:23 小菜鸟起飞ing
阅读(43)
评论(0)
推荐(0)
上一页
1
2
3
下一页
公告