排序
N27※python脚本
1> 一段时间内只允许调用1次函数 import time def once_per_period(period): def decorator(func): last_called = 0 def wrapper(*args, **kwargs): nonlocal last_called now = time.time()...
N26※微软语音库实现文字转音频
1> 安装库 pip3 install edge-tts 2> 段落文字转语音 edge-tts --text '微软语音测试库!' --write-media d:\output.mp3 --voice zh-CN-YunxiNeural edge-tts -f 'd:\input.txt' --write-...
N29※flask 编写后端api
1> 第一个程序 from flask import Flask app = Flask(__name__) @app.route('/') def hello(): return 'hello,world@' 2> 路由配置 ① 使用装饰器 @app.route(url_name, methods) ② 使用...
N30※chatgpt 中文调教
1> 充当英语翻译和改进者 我希望你能担任英语翻译、拼写校对和修辞改进的角色。我会用任何语言和你交流,你会识别语言,将其翻译并用更为优美和精炼的英语回答我。请将我简单的词汇和句子替换成...
N23※FFmpeg基础操作
1> FFmpeg 使用格式 ffmpeg {1} {2} -i {3} {4} {5} 全局参数输入文件参数输入文件输出文件参数输出文件 ffmpeg \ -y \ # 全局参数 -c:a libfdk_aac -c:v libx264 \ # 输入文件参数 -i input...
N11※python常用模块的用法
1> js2py模块 import js2py # 创建 js 执行环境 context = js2py.EvalJs() fun_js = ''' function add(a,b){ return a+b } ''' # 加载 js 文件 context.execute(fun_js) # 输出函数 print(co...
N13※python 发送手机通知
1> 注册配置 IFTTT 首先注册一个IFTTT账号 (https://ifttt.com).登录进入页面后点击右上角create,准备新建一个applet. 进去后点击 + this, 如图。 搜索 webhooks. 进去后选择Receive a web req...