会员
周边
新闻
博问
闪存
赞助商
YouClaw
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
sun8419082
博客园
首页
新随笔
联系
订阅
管理
2022年6月23日
requests库的使用
摘要: 一、get请求 import requests,json def http_get(url,city): parmas = {"city":city} headers = {} proxies= {"http":"http://localhost:8080","https":"https://loc
阅读全文
posted @ 2022-06-23 15:26 sun8419082
阅读(35)
评论(0)
推荐(0)
2021年4月20日
python线程池和进程池的异步调用
摘要: 1.线程池异步调用使用方式 from concurrent.futures import ThreadPoolExecutor,wait import time,os #要添加的进程任务 def eat(some): print("I'm eating{}".format(some)) time.s
阅读全文
posted @ 2021-04-20 16:00 sun8419082
阅读(477)
评论(0)
推荐(0)
2021年4月1日
python枚举类型
摘要: 1.导入 from enum import Enum 2.使用: from enum import Enum class Sun(Enum): username = 'suntao' age = 32 print(Sun.username.value) print(Sun.username.name
阅读全文
posted @ 2021-04-01 10:25 sun8419082
阅读(70)
评论(0)
推荐(0)
2021年3月31日
python 收发rabbitmq amqp消息
摘要: 1.安装 pip install pika #!/usr/bin/python # -*- coding: utf-8 -* """ 用于接收发送AMQP消息操作 """ import pika class AmqpConnect(): """AMQP消息收发""" def __init__(sel
阅读全文
posted @ 2021-03-31 18:12 sun8419082
阅读(361)
评论(0)
推荐(0)
python 收发rabbitmq mqtt消息
摘要: 1.安装 pip install paho-mqtt 2.使用 #!/usr/bin/python # -*- coding: utf-8 -* """ 接收mqtt消息 """ import paho.mqtt.client as mqtt import json,os import zlib i
阅读全文
posted @ 2021-03-31 18:08 sun8419082
阅读(902)
评论(0)
推荐(0)
python redis 集群操作
摘要: 1.安装:pip install redis-py-cluster 2.使用: #!/usr/bin/env python # encoding: utf-8 from rediscluster import RedisCluster class RedisClient: """redis相关操作类
阅读全文
posted @ 2021-03-31 17:52 sun8419082
阅读(159)
评论(0)
推荐(0)
python进度条模块
摘要: 1.安装 pip install tqdm 2.使用: from tqdm import tqdm import time for i in tqdm(range(10000)): time.sleep(0.01) from tqdm import trange import time for i
阅读全文
posted @ 2021-03-31 17:46 sun8419082
阅读(126)
评论(0)
推荐(0)
python好用的重试模块
摘要: 1.模块安装 pip install retrying 2.模块使用 from retrying import retry @retry(stop_max_attempt_number=3) def test1(): print("开始重试") raise NameError test1() 运行结
阅读全文
posted @ 2021-03-31 17:42 sun8419082
阅读(199)
评论(0)
推荐(0)
2020年12月29日
python表格操作
摘要: 1.xlrd常用方法 data = xlrd.open_workbook(file_name) #表格文件打开 table = data.sheets()[sheet_index] #sheet文档打开 name_data = table.col_values(name_index)#列数据获取,返
阅读全文
posted @ 2020-12-29 16:08 sun8419082
阅读(122)
评论(0)
推荐(0)
2020年6月22日
python好用的邮件发送库
摘要: import yagmail #链接邮箱服务器yag = yagmail.SMTP( user="397238915@qq.com", password="bmcbqzclkjzobjjd", host='smtp.qq.com') # 邮箱正文contents = ['ni nong shuo z
阅读全文
posted @ 2020-06-22 15:30 sun8419082
阅读(567)
评论(0)
推荐(0)
下一页
公告