![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
juggler.fun
这个作者很懒,什么都没留下…
展开
-
pytorch代码笔记
/watch?v=c36lUUr864M&t=936s 基本操作 import torch import numpy as np device = torch.device("cpu") if torch.cuda.is_available(): device = torch.device("cuda") x = torch.ones(2,2,dtype=torch.double) x.size() x = torch.rand(2,2,requires_grad=True,devic原创 2022-03-16 18:30:17 · 1944 阅读 · 0 评论 -
fastapi nacos
import nacos_py from fastapi import FastAPI import yaml from munch import munchify from starlette.requests import Request from starlette.responses import Response import traceback import sys import warnings sys.tracebacklimit = 3 # 限制打印错误行数 # 首先配置applic.原创 2022-01-06 14:18:57 · 1036 阅读 · 0 评论 -
python 操作mysql
之前写了mongo的,mentor说mysql会好一点。。 python -m pip install mysql-connector-python import mysql.connector class User: first_name = None last_name = None email = None password = None authority = None def __init__(self,Email,Password原创 2021-12-21 15:12:51 · 952 阅读 · 0 评论 -
python LRUCache
懒的写了抄的大佬的代码,因为要存储的东西单个对象有几个G所以加了点gc: class LRUCache(collections.OrderedDict): def __init__(self, size=2): #print(self.size) self.size = size, print(self.size) self.cache = collections.OrderedDict() def get(self, k...转载 2021-12-17 10:46:39 · 124 阅读 · 0 评论 -
python fasiapi 获得请求参数
Post请求体内的参数及路径参数 @app.post("/getlist/{query}") async def getlist(query:str,request:Request): data =await request.json() get路径参数及?后的参数: @app.get("/getlist/{query}") async def getPredict1(query:str): username = request.args.get("username") ...原创 2021-12-17 10:35:50 · 581 阅读 · 0 评论 -
Python 操作MongoDB
头次使用mongodb,留个小工具类也许以后用得上原创 2021-12-16 16:27:27 · 1056 阅读 · 0 评论