02 2023 档案

摘要:#!/usr/bin/env python # -*- encoding: utf-8 -*- # here put the import lib import os import subprocess import random import string def rename_mp4_files 阅读全文
posted @ 2023-02-06 10:44 无恙大势 阅读(1190) 评论(0) 推荐(0) 编辑
摘要:pip install python-docx #第一步先安装python-docx模块 import docx def replace_text_in_word_document(file_path, old_text, new_text): doc = docx.Document(file_pa 阅读全文
posted @ 2023-02-04 11:04 无恙大势 阅读(755) 评论(0) 推荐(0) 编辑
摘要:<a href="https://www.example.com"> <img src="image.jpg" style="width:100%; height:auto;"> </a> 阅读全文
posted @ 2023-02-02 14:22 无恙大势 阅读(17) 评论(0) 推荐(0) 编辑
摘要:import json def txt_to_json(file_path): with open(file_path, "r") as file: lines = file.readlines() data = {} for line in lines: key, value = line.str 阅读全文
posted @ 2023-02-02 00:38 无恙大势 阅读(1183) 评论(0) 推荐(0) 编辑
摘要:需要使用python-docx模块 pip install python-docx 然后函数主体 import os import docx2pdf def word_to_pdf(file_path): pdf_file = file_path.replace(".docx", ".pdf") d 阅读全文
posted @ 2023-02-02 00:03 无恙大势 阅读(1377) 评论(0) 推荐(0) 编辑
摘要:import requests def post_data(url, data, count): for i in range(count): response = requests.post(url, data=data) print(f"POST request {i + 1} returned 阅读全文
posted @ 2023-02-02 00:00 无恙大势 阅读(23) 评论(0) 推荐(0) 编辑
摘要:from PIL import Image, ImageDraw, ImageFont def add_text_to_image(image_path, text, font_path, font_size, text_color): image = Image.open(image_path) 阅读全文
posted @ 2023-02-01 23:57 无恙大势 阅读(280) 评论(0) 推荐(0) 编辑
摘要:需要在文件目录下面建一个urls.txt的文件,将所有要推送的url放到文本里。然后运行下面的脚本。 import requests def baidu_push(url, token): headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0 阅读全文
posted @ 2023-02-01 23:52 无恙大势 阅读(151) 评论(0) 推荐(0) 编辑
摘要:def read_txt_file(file_path): with open(file_path, 'r') as file: lines = file.readlines() return lines 阅读全文
posted @ 2023-02-01 23:30 无恙大势 阅读(188) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示