上一页 1 2 3 4 5 6 ··· 34 下一页
摘要: async def text_audio(text, audio_name): tts = edge_tts.Communicate( text=text, voice="zh-CN-XiaoxiaoNeural") await tts.save(audio_name) audio_name = " 阅读全文
posted @ 2024-06-13 11:32 一石数字欠我15w!!! 阅读(35) 评论(0) 推荐(0) 编辑
摘要: """ 多圈电机转动模式1 """ def decimal_to_hex_bytes(decimal_number, byte_size): # 检查字节大小参数的有效性 valid_sizes = {"int8": 1, "int16": 2, "int32": 4, "int64": 8} if 阅读全文
posted @ 2024-05-25 11:45 一石数字欠我15w!!! 阅读(73) 评论(0) 推荐(0) 编辑
摘要: import threading from datetime import datetime from peewee import Model, PostgresqlDatabase, AutoField, DateTimeField from playhouse.shortcuts import 阅读全文
posted @ 2024-01-08 09:53 一石数字欠我15w!!! 阅读(14) 评论(0) 推荐(0) 编辑
摘要: import asyncio import aioredis from config.env_config import REDIS_URL class RedisClient: def __init__(self, url, decode_responses=True, max_connectio 阅读全文
posted @ 2023-12-25 19:48 一石数字欠我15w!!! 阅读(9) 评论(0) 推荐(0) 编辑
摘要: package main import "fmt" const ( defaultName string = "张建平" defaultAge int = 27 defaultHigh int = 175 ) type User struct { Name string Age int High i 阅读全文
posted @ 2023-06-29 22:58 一石数字欠我15w!!! 阅读(9) 评论(0) 推荐(0) 编辑
摘要: version: "3" services: halo: image: halohub/halo:2.6 container_name: halo restart: on-failure:3 depends_on: halodb: condition: service_healthy network 阅读全文
posted @ 2023-06-08 18:14 一石数字欠我15w!!! 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 目前就想到了这两种 drf框架返回接口数据的时候返回count接口数据随着数据的增多查询缓慢! 1. 不返回总数据,前端采用下拉刷新方式获取 2. 主键采用int类型,每次返回最后一条数据id数即为总数(first().id - last().id + 1) from collections imp 阅读全文
posted @ 2023-05-29 17:37 一石数字欠我15w!!! 阅读(84) 评论(2) 推荐(0) 编辑
摘要: import cv2 from func_timeout import func_set_timeout, exceptions def check_rtsp_stream(url): @func_set_timeout(2) def parse_rtsp_stream(rtsp_address): 阅读全文
posted @ 2023-04-28 14:58 一石数字欠我15w!!! 阅读(511) 评论(3) 推荐(1) 编辑
摘要: import os import re import netifaces import subprocess class NetWorkConfig: def __init__(self): pass @staticmethod def check_network_isvalid(ip, netma 阅读全文
posted @ 2023-04-25 14:08 一石数字欠我15w!!! 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 效果图↓ 需要配置↓ index.html↓ <!DOCTYPE html> {% load i18n static %} {% load simpletags %} {% load customtags %} {% get_current_language as LANGUAGE_CODE %}{ 阅读全文
posted @ 2023-04-25 09:51 一石数字欠我15w!!! 阅读(575) 评论(1) 推荐(0) 编辑
摘要: 起源于一个比较奇葩的需求,默认的celery无法实现: 需要用户输入一个开始时间,结束时间,以及时间间隔,需要在该时间段内指定间隔执行 import datetime def task(start: datetime.datetime, end: datetime.datetime, interva 阅读全文
posted @ 2023-04-20 18:21 一石数字欠我15w!!! 阅读(127) 评论(0) 推荐(0) 编辑
摘要: from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import mode 阅读全文
posted @ 2023-04-07 15:38 一石数字欠我15w!!! 阅读(43) 评论(0) 推荐(0) 编辑
摘要: 1. 新增middleware.py中间件: 需要在setting.py注册 class LoggingMiddleware: """ 日志记录模块: 操作用户、操作ip、请求路径、请求方式、请求时间 """ def __init__(self, get_response): self.get_re 阅读全文
posted @ 2023-04-07 15:13 一石数字欠我15w!!! 阅读(640) 评论(0) 推荐(0) 编辑
摘要: import socket def get_local_ip(): """ 获取本机 IP 地址: 通用 """ try: s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect(('8.8.8.8', 80)) ip = s.g 阅读全文
posted @ 2023-04-04 14:38 一石数字欠我15w!!! 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 1. 创建middleware.py class InternalIPMiddleware: def __init__(self, get_response): self.get_response = get_response def __call__(self, request): # 获取请求头 阅读全文
posted @ 2023-04-04 14:37 一石数字欠我15w!!! 阅读(46) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 34 下一页
点击右上角即可分享
微信分享提示