python
伟大的python程序员
哈哈哈哈哈
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
python word转图片、word转pdf、pdf转图片API版本
python 文档转换pdf原创 2023-02-14 17:46:28 · 960 阅读 · 0 评论 -
pygame简单版飞机大战
python飞机大战,简易版飞机大战原创 2022-12-26 17:59:37 · 503 阅读 · 0 评论 -
word转图片,pdf转图片,doc转图片,docx转图片
word转图片,pdf转图片,doc转图片,docx转图片原创 2022-04-21 11:29:17 · 864 阅读 · 0 评论 -
python3爬取壁纸图片,python3切换壁纸
#!/usr/bin/python# encoding=utf-8import requestsfrom bs4 import BeautifulSoupclass bizhi: def getheaders(self): return { "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=.原创 2021-10-28 17:22:38 · 223 阅读 · 0 评论 -
python Requests cookie自动登录
#!/usr/bin/python# encoding=utf-8import requestsimport pickleimport jsonclass httpMain: session = None def __init__(self): self.session = requests.session() def getHeader(self): return { "Accept": "*/*", .原创 2021-09-28 09:29:31 · 473 阅读 · 0 评论 -
一个非常简单的python网络压力测试工具
#!/usr/bin/python#encoding=utf-8import requestsimport threading#保存线程idthreadId=[]def requesd(): #请求url url = "http://www.baidu.com" #携带的参数 payload = { 'type': 1, } #file文件 files = [ ] #请求头 headers = .原创 2020-12-04 17:53:39 · 799 阅读 · 0 评论 -
python3 copy文件夹到另一个文件夹,python复制整个文件夹,python复制文件夹到另一个文件夹
#diw 需拷贝的文件夹,newdir是拷贝的地方def copy_die(dir,newdir): for p in os.listdir(dir): print(p) filepath=newdir+'/'+p oldpath=dir+'/'+p if os.path.isdir(oldpath): ...原创 2020-04-22 13:24:29 · 4864 阅读 · 3 评论 -
python爬取网易云音乐,python下载网易云音乐
import requestsimport timeimport osfrom urllib import requestfrom bs4 import BeautifulSoupimport urllibclass Wy: page = 0 wymusic = {} headers = { 'Host': 'music.163.com', ...原创 2018-12-12 11:18:44 · 1712 阅读 · 0 评论 -
python 发送电子邮件
from smtplib import SMTPfrom email.header import Headerfrom email.mime.text import MIMEText#发送邮件def send_email(): # 请自行修改下面的邮件发送者和接收者 sender = 'abcdefg@126.com' receivers = ['a@qq.com', 'b@...原创 2018-12-13 15:45:45 · 399 阅读 · 0 评论 -
python 文件操作,读文件,写文件
#读取文件的全部内容def get(): f = None try: f = open('致橡树.txt', 'r', encoding='utf-8') print(f.read()) except FileNotFoundError: print('无法打开指定的文件!') except LookupErro...转载 2018-12-13 15:41:20 · 274 阅读 · 0 评论 -
python解压压缩包
import osimport shutildef scan_file(): for f in os.listdir(): #程序运行文件和需压缩的文件需同一目录 if f.endswith('.zip'): return fdef unzip_it(f): folder_name = f.split('.')[0] ta...原创 2018-12-03 11:53:05 · 545 阅读 · 0 评论 -
2018-11-28亲测有效的python线程终结,终止线程方法
import ctypesdef _async_raise(tid, exctype): """raises the exception, performs cleanup if needed""" if not inspect.isclass(exctype): exctype = type(exctype) res = ctypes.pythonap...原创 2018-11-28 14:21:38 · 859 阅读 · 0 评论 -
beautifulsoup怎么查找子元素?与抓取活动行页面数据
活动行界面:http://www.huodongxing.com/events?orderby=o&city=%E5%85%A8%E9%83%A8&page=1import requestsimport timefrom bs4 import BeautifulSouppage = 1def getid(): global page pages = r...原创 2018-11-27 14:02:19 · 4837 阅读 · 0 评论 -
python 微信机器人
# coding:utf-8from wxpy import *# 指定图片文件的路径image_path = "./time.png"# 初始化微信机器人bot = Bot()#给机器的好友列表robotFriendList = []#群聊列表robotGooupsList = []#需要发送的消息infos=[ { 'type': 'image'...原创 2018-11-30 09:29:30 · 312 阅读 · 1 评论
分享