03 2024 档案
摘要:不要再手动批量替换了,使用python AST模块批量替换_Python_阿呆_InfoQ写作社区 Python AST 抽象语法树 - 简书 (jianshu.com)
阅读全文
摘要:# 方法1 eval # 方法2 ast.literal_eval() >>> string_list = "[1, 2, 3, 4, 5]" >>> print(type(eval(string_list))) <class 'list'> >>> >>> print(type(string_li
阅读全文
摘要:flask接收客户端的get请求,读取本地文件并将文件返回给客户端 ,可用于文件下载功能_flask wsgi如何读取本地文件-CSDN博客 # -*- coding: utf-8 -*- from flask import Flask, render_template, send_file, se
阅读全文
摘要:# 方法1 import time # 获取当前时间戳 timestamp = int(time.time()) # 打印时间戳 print(f"当前时间戳:{timestamp}") # 当前时间戳:1711418156 # 方法2 import datetime # 创建一个示例的日期时间对象
阅读全文
摘要:def timestamp_difference_to_dhms(timestamp1, timestamp2): # 将时间戳转换为 datetime 对象 # # 13位时间戳会报错 if len(str(timestamp1)) == 13: timestamp1 = timestamp1 /
阅读全文
摘要:在Python中,可以使用html2text库将HTML内容转换成纯文本,保留一定的格式。首先需要安装这个库: pip install html2text 然后使用它的html2text函数将HTML转换为Markdown格式的文本: import html2text # 示例HTML内容 html
阅读全文
摘要:select phone from sp_user order by random() limit 1 ;
阅读全文
摘要:File Upload - web-api (seafile.com) 060-轻量级基于curl的seafile上传脚本 - 掘金 (juejin.cn) 在线curl命令转代码 (lddgo.net) from datetime import datetime import requests i
阅读全文
摘要:修改Ubuntu20.04 、Centos7.6的DNS_ubuntu20.04配置dns-CSDN博客
阅读全文
摘要:使用sudo su syan@syan:~$ sudo su [sudo] password for syan: root@syan:/home/syan#
阅读全文