上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 60 下一页

2023年8月28日

Python Tornado实现WebSocket通讯

摘要: 以下实例有点像广播通讯,支持多个客户端连接 代码参考别人的,稍微做了一点点修改 服务器端 websocket_demo.py # -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function from da 阅读全文

posted @ 2023-08-28 18:38 星河赵 阅读(328) 评论(0) 推荐(0)

2023年8月18日

Python修改图片Exif属性

摘要: 安装piexif包 pip install piexif 获取图片Exif 信息 exif_dict = piexif.load("foo1.jpg") for ifd in ("0th", "Exif", "GPS", "1st"): for tag in exif_dict[ifd]: prin 阅读全文

posted @ 2023-08-18 18:19 星河赵 阅读(1142) 评论(0) 推荐(0)

2023年7月20日

Python 上传文件request.files无法二次保存

摘要: Python 上传文件request.files无法二次保存 或读取文件无法二次read 假设现在有个文本文件对象,对象名是text,其中内容为“梧桐半死清霜后”,可供读写。 如下代码,尝试读取两次文件内容。 print("第一次读取:", text.read()) print("第二次读取:", 阅读全文

posted @ 2023-07-20 11:29 星河赵 阅读(241) 评论(0) 推荐(0)

2023年5月19日

centos yum 安装uwsgi错误

摘要: python 3.8 安装 yum install -y python38-devel.x86_64 阅读全文

posted @ 2023-05-19 18:28 星河赵 阅读(52) 评论(0) 推荐(0)

2023年5月4日

Linux 查看日志的常用命令

摘要: 1.查询最近多少条日志: tail -n 100 default.log 2.根据关键字查询日志: cat -n default.log |grep 'error' 3.根据关键字查出后多少行的日志 tail -n 100 file.log | grep "关键字" 4.根据关键字查出后100行中包 阅读全文

posted @ 2023-05-04 11:00 星河赵 阅读(988) 评论(0) 推荐(0)

2023年4月24日

Python3 协程并发对比串行下载文件

摘要: 通过 asyncio 和 aiohttp 协程下载文件控制在3秒以内 串行要20秒 import time import aiohttp import asyncio import requests def down_img(url, i): r = requests.get(url) save_p 阅读全文

posted @ 2023-04-24 18:21 星河赵 阅读(103) 评论(0) 推荐(0)

2023年4月17日

python3 协程 async await用法

摘要: Python 3 中的协程是异步编程的一种形式,它允许您在代码中创建可暂停的函数,以便其他任务可以运行,而不会阻塞程序的执行。async/await 是 Python 3.5 之后引入的语法,用于编写协程。 下面是一些协程和 async/await 的用法示例: 使用 async 关键字定义协程函数 阅读全文

posted @ 2023-04-17 15:58 星河赵 阅读(912) 评论(0) 推荐(0)

2023年4月16日

docker 容器访问宿主redis和mongo配置

摘要: 容器内:host.docker.internal 相当于宿主机器:127.0.0.1 阅读全文

posted @ 2023-04-16 21:04 星河赵 阅读(185) 评论(0) 推荐(0)

2023年2月27日

ubuntu中更新安装node.js

摘要: sudo apt update #下载Ubuntu下的nodejs sudo apt install nodejs #安装新版的node 和npm sudo apt-get install curl curl -sL https://deb.nodesource.com/setup_18.x | s 阅读全文

posted @ 2023-02-27 14:50 星河赵 阅读(149) 评论(0) 推荐(0)

2023年2月24日

Ubuntu20.04如何更换国内源

摘要: 1.打开终端。 2.输入以下命令备份原来的源。 sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak 3.再输入以下命令打开sources.list配置文件更换源。 sudo vim /etc/apt/sources.list 配置内容如下 阅读全文

posted @ 2023-02-24 10:27 星河赵 阅读(15904) 评论(0) 推荐(1)

上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 60 下一页

导航