~玉米糊~
慢慢来,也会很快。 非宁静无以志学,学什么都一样,慢慢打基础,找规律、认真、坚持,其余的交给时间。
随笔 - 117,  文章 - 17,  评论 - 1,  阅读 - 81792

随笔分类 -  python

1 2 下一页
python UTC时间格式转换为北京时间
摘要:2022-03-23T08:40:10.895Z 这样的UTC时间格式转化为北京时间 from datetime import datetime, timedelta push_time = '2022-03-23T08:40:10.895Z' push_time1 = datetime.strpt 阅读全文
posted @ 2022-03-24 09:23 yuminhu 阅读(1585) 评论(0) 推荐(0) 编辑
X编码 U编码 与 中文 转换
摘要:# X 编码 b="\xE6\x88\x91\xE6\x98\xAF\xE8\xAF\xB7\xE6\xB1\x82" # U编码 c='\u4eca\u65e5\u5df2\u7ecf\u5b8c\u6210\u8fc7\u6b64\u4efb\u52a1\uff0c' print(b) prin 阅读全文
posted @ 2022-03-14 13:44 yuminhu 阅读(788) 评论(0) 推荐(0) 编辑
高并发场景下Python的性能挑战
摘要:高并发场景下Python的性能挑战 Python后台开发的高并发场景优化解决方案 24式,加速你的Python python解决高并发-python高并发的详解 阅读全文
posted @ 2022-03-11 18:29 yuminhu 阅读(118) 评论(0) 推荐(0) 编辑
python-docs
摘要:内置函数 阅读全文
posted @ 2022-03-10 18:40 yuminhu 阅读(33) 评论(0) 推荐(0) 编辑
关于Tornado:真实的异步和虚假的异步
摘要:关于Tornado:真实的异步和虚假的异步 Python3的原生协程(Async/Await)和Tornado异步非阻塞 Python中协程异步IO(asyncio)详解 python中的generator(coroutine)浅析和应用 Python协程与异步asyncio总结 阅读全文
posted @ 2022-03-10 18:39 yuminhu 阅读(28) 评论(0) 推荐(0) 编辑
Docker实践
摘要:四位一体水溶交融,Docker一拖三Tornado6.2 + Nginx + Supervisord非阻塞负载均衡容器式部署实践 利用DockerHub在Centos7.7环境下部署Nginx反向代理Gunicorn+Flask独立架构 https://v3u.cn/a_id_165 Docker在 阅读全文
posted @ 2022-03-10 17:44 yuminhu 阅读(21) 评论(0) 推荐(0) 编辑
Python加密与解密(一文搞定)
摘要:前言 据记载,公元前400年,古希腊人发明了置换密码。1881年世界上的第一个电话 保密专利出现。在第二次世界大战期间,德国军方启用“恩尼格玛”密码机, 密码学在战争中起着非常重要的作用。 随着信息化和数字化社会的发展,人们对信息安全和保密的重要性认识不断提高, 于是在1997年,美国国家标准局公布 阅读全文
posted @ 2022-03-09 11:33 yuminhu 阅读(11104) 评论(0) 推荐(2) 编辑
python中的f.b.u.r函数
摘要:1. f 格式化操作,相当于format()函数 1 name = 'wy' 2 s = f'{{"name": "{name}"}}' 3 print(s) {"name": "wy"} f-string,亦称为格式化字符串常量(formatted string literals),是Python 阅读全文
posted @ 2022-03-07 17:43 yuminhu 阅读(245) 评论(0) 推荐(0) 编辑
python asyncio 异步 I/O - 协程(Coroutine)与运行
摘要:前言 Python 在 3.5 版本中引入了关于协程的语法糖 async 和 await, 在 python3.7 版本可以通过 asyncio.run() 运行一个协程。所以建议大家学习协程的时候使用 python3.7+ 版本,本文示例代码在 python3.8 上运行的。 协程 corouti 阅读全文
posted @ 2022-03-02 11:38 yuminhu 阅读(126) 评论(0) 推荐(0) 编辑
python asyncio 异步 I/O - 实现并发http请求(asyncio + aiohttp)
摘要:前言 如果需要并发 http 请求怎么办呢?requests库是同步阻塞的,必须等到结果才会发第二个请求,这里需使用http请求异步库 aiohttp。 环境准备 aiohttp 用于 asyncio 和 Python 的异步 HTTP 客户端/服务器。使用pip安装对应的包。当前使用版本v3.8. 阅读全文
posted @ 2022-03-02 11:14 yuminhu 阅读(368) 评论(0) 推荐(0) 编辑
Python 之 lambda 函数完整详解 & 巧妙运用
摘要:一、前言 lambda 函数在 Python 编程语言中使用频率非常高,使用起来非常灵活、巧妙; 那么,什么是lambda ?它有哪些用法和应用场景呢 ? 下面让我一起来解读 lambda的神秘之处 ! 二、lambda 语法lambda 函数的语法只包含一个语句,表现形式如下: lambda [a 阅读全文
posted @ 2022-01-28 16:50 yuminhu 阅读(8144) 评论(0) 推荐(0) 编辑
python scheduler 定时执行_Python使用APScheduler实现定时任务
摘要:简介:APScheduler是基于Quartz的一个Python定时任务框架。提供了基于日期、固定时间间隔以及crontab类型的任务,并且可以持久化任务。 在线文档:https://apscheduler.readthedocs.io/en/latest/userguide.html 一、安装AP 阅读全文
posted @ 2022-01-04 16:43 yuminhu 阅读(990) 评论(0) 推荐(0) 编辑
如何查看sqlalchemy执行的原始sql语句?
摘要:SQLAlchemy打开SQL语句方法如下,echo=true将开启该功能: engine = create_engine("<db_rul>", echo=True) Flask-SQLAlchemy打开SQL方法如下: app.config["SQLALCHEMY_ECHO"] = True 阅读全文
posted @ 2021-12-28 11:06 yuminhu 阅读(371) 评论(0) 推荐(0) 编辑
fastapi- 修改 uvicorn 的日志格式
摘要:背景默认启动 uvicorn 之后,访问接口会有打印日志,如下 但我觉得这个日志满足不了我,我想加内容,比如时间戳,那要怎么操作捏 首先打断点 debug 走起 F7 进到内部 ctrl + 点击 Config,然后往下看有一个 log_config ctrl + 点击 LOGGIN_CONFIG 阅读全文
posted @ 2021-12-22 17:28 yuminhu 阅读(1151) 评论(0) 推荐(0) 编辑
Python - logging.Formatter 的常用格式字符串
摘要:格式字符串 作用 %(name)s 日志记录器的名称(记录通道) %(levelno)s 日志记录级别的数字 DEBUG=10、INFO=20、WARNING=30、ERROR=40、CRITICAL=50 %(levelname)s 日志记录级别的文本 “DEBUG”、“INFO”、“WARNIN 阅读全文
posted @ 2021-12-22 17:24 yuminhu 阅读(100) 评论(0) 推荐(0) 编辑
Python 列表(List) 的三种遍历(序号和值)方法
摘要:#!/usr/bin/env python # -*- coding: utf-8 -*- if __name__ == '__main__': list = ['html', 'js', 'css', 'python'] # 方法1 print('遍历列表方法1:') for i in list: 阅读全文
posted @ 2021-12-21 10:35 yuminhu 阅读(507) 评论(0) 推荐(0) 编辑
python两个字符串有变化值作对比
摘要:1 def replace_star(actual, expect): 2 count = 0 3 for expect_char in expect: 4 count += 1 5 if expect_char == '*': # 遍历预期字符串,找到*位置 6 actual = actual[: 阅读全文
posted @ 2021-11-29 14:23 yuminhu 阅读(52) 评论(0) 推荐(0) 编辑
python xml_str转json
摘要:1 import json 2 import xmltodict 3 4 def xmlToJson(xml_str): 5 '''传入xml字符串,返回字典''' 6 dic = xmltodict.parse(xml_str, encoding='utf-8') 7 dic = json.dum 阅读全文
posted @ 2021-11-29 13:30 yuminhu 阅读(63) 评论(0) 推荐(0) 编辑
Python多线程(生成动态参数)
摘要:import threading import datetime import pymssql import time from faker import Faker def insert_db(): for i in range(100): for j in range(100): print(j 阅读全文
posted @ 2021-11-29 13:28 yuminhu 阅读(188) 评论(0) 推荐(0) 编辑

1 2 下一页

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示