安装完成后: 1.先访问publish页面在线安装插件 2.访问要操作的页面,点击新建客户端打开文件,会自动调起本地的wps并加载test.docx文件
安装完成后: 1.先访问publish页面在线安装插件 2.访问要操作的页面,点击新建客户端打开文件,会自动调起本地的wps并加载test.docx文件
import os from win32com.client import Dispatch, constants, gencache, DispatchEx class PDFConverter: def __init__(self, pathname, export='.'): self._handle_postfix = ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx'] self._filename_list = list() self._export_folder …
解决方法如下: def register_cors(app: FastAPI): """ 支持跨域 貌似发现了一个bug https://github.com/tiangolo/fastapi/issues/133 :param app: :return: """ app.add_middleware( CORSMiddleware, # allow_origins=['http://localhost:8081'], # 有效, 但是本地vue端口一直在变化, 接口给其他人用也不一定是这个端口 # …
现在用python的fastapi做了一个后台部署在服务器上,前端采用的vue-ant-admin,直接调用fastapi一直出错 发现是跨域问题,按照网上查询的fastapi做跨域配置: import uvicorn from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware app = FastAPI() origins = [ "http://localhost.tiangolo.com", "ht…
之前写过有C#版本的功能,此为python版本参考: import cv2 as cv import numpy as np from matplotlib import pyplot as plt from PIL import ImageGrab import os import sys imtest = ImageGrab.grab((0,0,1000,1000)) #可以添加一个坐标元组进去 imtest.save('test.png') img_rgb = cv.imread('test.png') im…
下载指定js: stealth.min.js 操作登录代码: from selenium import webdriver from common.CacheConfig import * from drivers.BaseDriver import BaseDriver class ChromeDriver(BaseDriver): """Chrome 驱动器加载""" def create_driver(self,hasHeader=False): try: options = webdriver.Chrome…
import smtplib from email.mime.text import MIMEText from email.header import Header # 第三方 SMTP 服务 mail_host="smtp.exmail.qq.com" #设置服务器 mail_user="xxxx.com" #用户名 mail_pass="xxxx" #口令 sender = 'xxxx@xxxx.com' receivers = ['xxxxx@qq.com'] # 接收邮件,可设置为你的QQ邮箱或者其他邮箱…
import codecs import os import PyPDF2 as PyPDF2 def mergePdf(path,files,saveName): pdfwriter = PyPDF2.PdfFileWriter() for item in files: pdfreader = PyPDF2.PdfFileReader(open(path + '/' + item,"rb")) for page in range(pdfreader.numPages): pdfwriter.addPage(pdf…
import os import fitz import glob import requests os.environ['NLS_LANG'] = 'SIMPLIFIED CHINESE_CHINA.UTF8' #剪切pdf为图片 def CutPdf(pdfPath,savePath,pdfSavePath): try: doc = fitz.open(pdfPath) #pdf路径 for pg in range(doc.pageCount): page = doc[pg] rotate = int(0) #…
import cv2 import os import sys import time import json #path = "JPEGImages\\3.jpeg" #image = cv2.imread(path) #cropImg = image[0:200,0:200] #cv2.imwrite("ttt.jpg",cropImg) def main(): output_dir = "img_cut" input_dir = "JPEGImages" img_paths = get_img(input_d…