![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
青石玄霄
吾生也有涯,而知也无涯
展开
-
python爬虫
爬虫页面结构<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"/> <title>Title</title></head><body><!-- table 表格 tr 行 td 列 --> <table width="200px" height="200px" bor原创 2021-10-12 23:34:49 · 159 阅读 · 0 评论 -
python基础
pip isntall -i 国内源#单行注释‘’‘’‘’ 多行注释运算符与流程控制变量List列表 []tuple 元组 ()dict 字典 {}str 字符串boolintfloat类型转换闭坑#打印Truea = Trueb = str(a)print(b)# 列表中无数据,就是Falsea = []print(type(a))b = bool(a)print(b)算数运算符a = 3b = 2# 除 1.5print(a/b)# 取整除原创 2021-09-05 22:52:48 · 112 阅读 · 0 评论 -
python 解析pcap数据长度
# -*- coding: UTF-8 -*-import dpktimport collections # 有序字典需要的模块import timedef main(file_path): f = open(file_path, 'rb') #python3 pcap = dpkt.pcap.Reader(f) # 先按.pcap格式解析,若解析不了,则按pcapng格式解析 all_pcap_data = collections.OrderedDict().原创 2021-01-06 00:09:10 · 1445 阅读 · 2 评论 -
python将文件夹内文件拷贝到指定目录并删除原有文件
import osimport shutilimport sysfrom tqdm import tqdmdef copyfile(src_dir, dst_dir): if not os.path.exists(dst_dir): os.makedirs(dst_dir) if os.path.exists(src_dir): for root, dirs, files in os.walk(src_dir): fo.原创 2021-01-06 00:11:52 · 454 阅读 · 0 评论