logo
publist
写文章

简介

该用户还未填写简介

擅长的技术栈

可提供的服务

暂无可提供的服务

python round函数 竟然把5舍去了

Python 3.6.1 (default, Sep7 2017, 16:36:03)[GCC 6.3.0 20170406] on linuxType "help", "copyright", "credits" or "license" for more information.>>> round(3.5)4>>> round(3.55, ...

前端vue项目响应时间优化

场景:项目部署在/dist/这个子路径下, 扫码打开页面要8s, 目标是优化到2s内解决:将yarn build出来的dist整个文件夹上传到对象存储里(之前做视频点播开通了鹅厂的账号,所以这次也用它的)然后在nginx里配置重定向.vue.config.jsconst cdnDomain = '';const deployPath = "/dist/";module.exports = {pro

ubuntu18安装yarn、安装vue

操作系统为ubuntu18第一步:换源sudo python -c "s='mirrors.163.com';import re;f=open('/etc/apt/sources.list','r+');a=f.read();f.seek(0);f.truncate();f.write(re.sub(r'(deb|security)\.debian\.org', s, a));f.clo

#yarn#vue.js#debian
gnome-terminal 出错 ImportError: cannot import name '_gi'

系统:ubuntu17装了python2.7.13, 之后陆续装了python3.5.3, python3.6.1本来默认的python版本是2.7, 改为3.6后, 就出现gnome-terminal用不了的问题:$ gnome-terminalTraceback (most recent call last):  File "/usr/bin/gnome-terminal",

使用mirror.ghproxy.com加速raw.githubusercontent.com以解决brew upgrade python@3.12慢的问题

MacOS系统上,升级python3.12时,超级慢,而且最后还失败了。看了日志,发现是用curl从raw.githubusercontent.com上下载Python安装包超时了。解决方案:使用raw.gitmirror.com替换raw.githubusercontent.com。

文章图片
#python#开发语言
Where there is a Will there is a way.

安利一个很有意思的python库--rich安装:使用效果更多前情提要:github给推荐的,star有18k的python库,然后我竟然没了解过…安装:直接pippip install rich使用from rich import printprint("Where there is a [bold cyan]Will[/bold cyan] there [u]is[/u] a [i]way[/

#python
FastAPI访问/docs接口文档显示空白、js/css无法加载

FastAPI的接口文档页面空白,可考虑使用插件fastapi-cdn-host来解决,只需增加一行代码即可:fastapi_cdn_host.monkey_patch(app)

文章图片
#fastapi
FastAPI图片上传接口

需求:上传一个图片,保存到服务器,然后返回一个URL# main.py#!/usr/bin/env python3.8import hashlibfrom aiopathlib import AsyncPath# pip install aiopathlibfrom pathlib import Pathfrom fastapi import Request, File, FastAPIfrom

文章图片
#服务器#linux#运维
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-GVQWxt/ipython/

在虚拟环境virtualenv中安装ipython时出现Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-GVQWxt/ipython/的错误, python版本2.7(.env) ...$ pip install ipythonCollecting ipythonDownload

django Warning: (3135, "'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes

python manage.py runserver 出现如下警告:/home/wenjie/work/blockchain-display/env/lib/python3.6/site-packages/pymysql/cursors.py:166: Warning: (3135, "'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVIS

#django
    共 11 条
  • 1
  • 2
  • 请选择