随笔分类 -  其他

python相关知识点
摘要:import time import datetime class TimeAbout(): def TimeStamp(self, **kwargs): _ = self """ 获取时间戳 """ t = kwargs.get('time') if t is None: return int(t 阅读全文
posted @ 2021-11-25 18:15 167 阅读(40) 评论(0) 推荐(0)
摘要:import os import sys # 当前文件夹 curry_dir = os.path.dirname(os.path.abspath(__file__)) # 项目根目录 libsPathList = os.path.abspath(os.path.join(curry_dir, '.. 阅读全文
posted @ 2021-11-25 17:56 167 阅读(48) 评论(0) 推荐(0)
摘要:快速读取文件指定行 # 写入 s = '[2021-5-25 12:41:9];192.168.0.110;0.0.0.0;init-setting' with open('log.txt', 'a', encoding='utf-8') as w: for i in range(100000): 阅读全文
posted @ 2021-11-25 17:53 167 阅读(1095) 评论(0) 推荐(0)
摘要:# python 如何识别字符串中的人名 ,如何识别一串拼音字符串以及韵母的提取 ## 一、识别字符串中的人名或特定名词 ### 1.安装Python SDK ~~~markdown 安装方法:pip install baidu-aip ~~~ ### 2.获取APP ID ~~~markdown 阅读全文
posted @ 2021-11-25 17:51 167 阅读(1537) 评论(0) 推荐(0)
摘要:ele = detail_html.xpath('//*[@id="content"]/article/section/div/div')[0] print(ele) from xml.etree import ElementTree xml_str = ElementTree.tostring(e 阅读全文
posted @ 2021-11-25 17:47 167 阅读(2127) 评论(0) 推荐(0)
摘要:import xmltodict import json import dicttoxml """ XML转化为JSON格式 安装xmltodict pip install xmltodict """ def xmlTojson(): with open('11.xml', 'r', encodin 阅读全文
posted @ 2021-11-25 17:46 167 阅读(952) 评论(0) 推荐(0)
摘要:(1)阿里云 http://mirrors.aliyun.com/pypi/simple/ (2)豆瓣 http://pypi.douban.com/simple/ (3)清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/ (4)中国科学技术大学 http: 阅读全文
posted @ 2021-11-25 17:45 167 阅读(30) 评论(0) 推荐(0)
摘要:import sys # 实现从程序外部向程序传递参数。 # print(sys.argv) # 程序中间的退出,arg=0为正常退出。 # print(sys.exit(['0'])) # 获取系统当前编码,一般默认为ascii。 print(sys.getdefaultencoding()) # 阅读全文
posted @ 2021-11-25 17:44 167 阅读(87) 评论(0) 推荐(0)