随笔分类 -  python

摘要:python 递归上传文件到阿里云oss import os import oss2 import json # 阿里云 OSS 访问信息 access_key_id = 'xxxxxxxxx' access_key_secret = 'xxxxxxxxxxxxx' endpoint = 'xxxx 阅读全文
posted @ 2023-11-10 10:12 蒲公英PGY 阅读(152) 评论(0) 推荐(0) 编辑
摘要:cat python_oss.py #!/usr/bin/python # -*- coding: utf-8 -*- # @time : 2023/2/23 14:29 # @author : pugongying # @description : from __future__ import p 阅读全文
posted @ 2023-03-08 17:19 蒲公英PGY 阅读(549) 评论(0) 推荐(0) 编辑
摘要:wwechat.py ```python #!/usr/bin/python # coding:utf-8 # 2016-01-18 import urllib, urllib2 import json import sys import logging import subprocess relo 阅读全文
posted @ 2022-06-07 14:46 蒲公英PGY 阅读(131) 评论(0) 推荐(0) 编辑
摘要:```python # -*- coding: utf-8 -*- # @Time : 2020-07-14 # @Author : pugongying import smtplib from email.mime.text import MIMEText from email.utils imp 阅读全文
posted @ 2022-06-07 14:00 蒲公英PGY 阅读(43) 评论(0) 推荐(0) 编辑
摘要:# python使用AliyunOpenApi获取MongoDB监控数据 Mongo_cpu.py ```python import sys import json import datetime,time from json import loads, dumps from typing impo 阅读全文
posted @ 2022-06-07 13:58 蒲公英PGY 阅读(105) 评论(0) 推荐(0) 编辑
摘要:# python使用AliyunOpenApi获取ecs监控数据 ecs.py ```python #!/usr/bin/env python #coding=utf-8 import json import datetime,time from aliyunsdkcore.client impor 阅读全文
posted @ 2022-06-07 13:51 蒲公英PGY 阅读(106) 评论(0) 推荐(0) 编辑
摘要:# python使用AliyunOpenApi获取arms数据 arms_class.py ```python from aliyunsdkcore.client import AcsClient from aliyunsdkcore.acs_exception.exceptions import 阅读全文
posted @ 2022-06-07 13:49 蒲公英PGY 阅读(186) 评论(0) 推荐(0) 编辑
摘要:# python操作pgsql备份还原 common.py ```python #!/usr/bin/env python # encoding: utf-8 import argparse dbs = [ "test1", "test2" ] # ct: pgsql容器的名称 ct = "pg" 阅读全文
posted @ 2022-06-07 11:29 蒲公英PGY 阅读(274) 评论(0) 推荐(0) 编辑
摘要:# python使用FastAPI返回简单html页面 ```python # pip install uvicorn prometheus_client # pip install fastapi yaml # uvicorn main:app --reload from fastapi impo 阅读全文
posted @ 2022-06-07 11:16 蒲公英PGY 阅读(1290) 评论(0) 推荐(0) 编辑
摘要:# python 调用dingding的API进行消息发送 使用python的fastapi快速构建后端api接口 ```python # pip install fastapi requests uvicorn from typing import Set from fastapi import 阅读全文
posted @ 2022-06-07 11:11 蒲公英PGY 阅读(295) 评论(0) 推荐(0) 编辑
摘要:python 调用Jenkins的API进行发布 # pip install pyyaml==5.4.1 import json import requests,sys,os,time import requests,sys from requests.auth import HTTPBasicAu 阅读全文
posted @ 2022-06-07 11:05 蒲公英PGY 阅读(251) 评论(0) 推荐(0) 编辑
摘要:```python # pip3 install requests import requests,sys,os,time from requests.packages import urllib3 urllib3.disable_warnings() def get_tags (base_url, 阅读全文
posted @ 2022-06-07 10:18 蒲公英PGY 阅读(381) 评论(0) 推荐(0) 编辑
摘要:```python # pip install uvicorn # pip install fastapi # uvicorn main:app --reload # pip install ruamel.yaml from fastapi import FastAPI from fastapi.r 阅读全文
posted @ 2022-06-06 17:49 蒲公英PGY 阅读(325) 评论(0) 推荐(0) 编辑
摘要:python3 -m pip install --upgrade pip 阅读全文
posted @ 2022-05-12 10:23 蒲公英PGY 阅读(143) 评论(0) 推荐(0) 编辑
摘要:解决方式,增加一个将set转为list的函数: ```python def set_default(obj): if isinstance(obj, set): return list(obj) raise TypeError message_json = json.dumps(msg, defau 阅读全文
posted @ 2022-03-25 17:41 蒲公英PGY 阅读(1034) 评论(0) 推荐(0) 编辑
摘要:# **一、概述** 一般对于Request Body不会通过get提交,对于get提交的参数一般称为是查询参数。所以,如果是通过POTS,PUT等方式提交的参数信息,我们一般是放到Request Body来提交到我们的后端。 对于如何接收和校验请求体,FastApi提供的形式是使用:from py 阅读全文
posted @ 2022-03-25 17:13 蒲公英PGY 阅读(348) 评论(0) 推荐(0) 编辑

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