随笔分类 -  python

随手写的python
摘要:利用websocket调用浏览器中的方法 js client //连接websocket服务端 var ws = new WebSocket('ws://localhost:8000/ws'); //连接成功时执行 ws.onopen = function () { console.log('bro 阅读全文
posted @ 2021-08-13 15:23 SirPi 阅读(414) 评论(0) 推荐(0)
摘要:##启动 mitmdump -s http_proxy.py -p 9000 替换js代码 # -*- coding: utf-8 -*- import re main_url = 'http://match.yuanrenxue.com/match/9' # 9 js_url = 'http:// 阅读全文
posted @ 2021-06-03 15:06 SirPi 阅读(223) 评论(0) 推荐(0)
摘要:user_agent_list = [ "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; AcooBrowser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)", "Mozilla/4.0 (compa 阅读全文
posted @ 2021-05-30 10:38 SirPi 阅读(337) 评论(0) 推荐(0)
摘要:# -*- coding: UTF-8 -*- from Crypto.Util.Padding import pad from Crypto.Cipher import AES import base64 def aes_cipher(encrypt_key, plain): aes = AES. 阅读全文
posted @ 2021-05-25 19:43 SirPi 阅读(1151) 评论(0) 推荐(0)
摘要:代码如下: # -*- coding: utf-8 -*- import requests import re import os import base64 from Crypto.Cipher import AES from Crypto.Util.Padding import pad, unp 阅读全文
posted @ 2021-04-15 17:37 SirPi 阅读(689) 评论(0) 推荐(0)
摘要:目的:将数据追加进excel def writeExcel(list, save_path,excel_header,excel_sheet_name): """ write to excel 需要导入的库: from openpyxl import Workbook from openpyxl i 阅读全文
posted @ 2021-03-24 17:54 SirPi 阅读(732) 评论(0) 推荐(0)
摘要:def downloadFile(url, filepath): """ 下载文件并保存 :param url: :param filepath: :return: """ # 获取文件后缀 # file_extension = os.path.splitext(url)[1] # 判断文件是否存在 阅读全文
posted @ 2021-03-23 17:14 SirPi 阅读(71) 评论(0) 推荐(0)
摘要:word ==> pdf def doc2pdf(file_path): """ word格式转换doc|docx ==> pdf :return: """ file_name, file_extension = os.path.splitext(file_path) # 获取文件名、文件扩展名 f 阅读全文
posted @ 2021-03-23 17:13 SirPi 阅读(242) 评论(0) 推荐(0)