2018年9月20日

【python】按顺序排列组合输出字符串

摘要: 在博问上问了一个排列组合的问题,刚开始一直没有人回答,后来终于等到一位用户名为“开心的小草(https://home.cnblogs.com/u/kaixindexiaocao/)”来帮助我解决我问题。 他回答德很详细,而且还贴图给我,真的感到很温暖很感动。我把他的代码重新整理了一遍发到博客里分享。 阅读全文

posted @ 2018-09-20 09:34 芽衣 阅读(5195) 评论(1) 推荐(0) 编辑

2018年8月24日

【python】通过LibreOffice把html文件转换成docx文件

摘要: 通过下面的一行命令,把test.html转换成test.docx soffice --invisible --headless --convert-to docx:"Office Open XML Text" test.html 如果想要用python来执行这个命令的话:(请注意"Office Op 阅读全文

posted @ 2018-08-24 16:25 芽衣 阅读(1021) 评论(0) 推荐(0) 编辑

【python】判断一个地址是ipv4还是ipv6

摘要: from netaddr.ip import IPAddress def isIP4or6(cfgstr): ipFlg = False if '/' in cfgstr: text = cfgstr[:cfgstr.rfind('/')] else: text = cfgstr try: addr = IPAddress(text) ipFlg = True ... 阅读全文

posted @ 2018-08-24 14:29 芽衣 阅读(7978) 评论(0) 推荐(0) 编辑

【python】判断一个字符串是否是数字

摘要: def is_number(s): try: float(s) return True except ValueError: pass try: import unicodedata unicodedata.numeric(s) return True except (TypeError, ValueError): pass return False... 阅读全文

posted @ 2018-08-24 11:20 芽衣 阅读(5642) 评论(1) 推荐(0) 编辑

【python】ImportError: cannot import name 'QWebView'

摘要: 报错原因:WebEngine和WebKit混合在一起使用解决方法:下面两种写法选其中一种写法。WebEngine:from PyQt5.QtWebEngineWidgets import QWebEnginePagefrom PyQt5.QtWebEngineWidgets import QWebE 阅读全文

posted @ 2018-08-24 08:22 芽衣 阅读(2844) 评论(0) 推荐(0) 编辑

【python】ModuleNotFoundError: No module named 'PyQt5.QtWebKitWidgets'

摘要: 解决方法:把旧的写法from PyQt5.QtWebKitWidgets import *改成新的写法from PyQt5.QtWebEngineWidgets import * 参考来自:https://blog.csdn.net/karmacode/article/details/8055815 阅读全文

posted @ 2018-08-24 08:21 芽衣 阅读(6834) 评论(1) 推荐(0) 编辑

2018年8月18日

【GNS3】Error 9: Unknown boot failure

摘要: 报错内容: 打开console之后,命令行显示“Error 9: Unknown boot failure”解决方法:输入以下命令boot <你的nxos-image名字>(例:boot bootflash://nxos.7.0.3.I7.4.bin)出错防止: switch# configure 阅读全文

posted @ 2018-08-18 22:50 芽衣 阅读(466) 评论(0) 推荐(0) 编辑

【GNS3】【NX-OSv9000】POAP DHCP discover phase failed

摘要: 报错内容: 打开console之后,一直重复显示“POAP DHCP discover phase failed”,并且没有停下来的迹象。无法输入命令。解决方法:1.输入回车或"Ctrl+C"2.命令行显示" Abort Auto Provisioning and continue with nor 阅读全文

posted @ 2018-08-18 22:49 芽衣 阅读(722) 评论(0) 推荐(0) 编辑

【GNS3】VMware vmrun tool could not be found

摘要: 报错内容: VMware vmrun tool could not be found, VMware or the VIX API (required for VMware player) is probably not installed. You can download it from htt 阅读全文

posted @ 2018-08-18 22:42 芽衣 阅读(2146) 评论(0) 推荐(0) 编辑

2017年11月25日

【python】列表中数字的元素变整型,其他元素保持原有数据型

摘要: 把字符串"File1 alias File2 45332"变成列表,但是转换之后所有元素都变成字符串型了,把数字“45332”变成整型,但不影响其他元素。 阅读全文

posted @ 2017-11-25 23:22 芽衣 阅读(6911) 评论(2) 推荐(0) 编辑

导航