- 博客(17)
- 收藏
- 关注
原创 Enumerating objects: 16, done. Delta compression using up to
【代码】Enumerating objects: 16, done. Delta compression using up to
2022-08-19 23:44:12 396 1
原创 KeyError: ‘formatters‘ [2508] Failed to execute script
KeyError: 'formatters' [2508] Failed to execute script
2022-08-17 15:06:04 495
原创 python requests socks
import requestsproxies = { 'http': 'socks5://127.0.0.1:1080', 'https': 'socks5://127.0.0.1:1080'}r=requests.get('https://www.google.com', proxies=proxies)print(r.status_code)
2021-08-23 22:51:48 228
原创 ConfigParser.MissingSectionHeaderError: File contains no section headers.
报错将 utf-8 改为utf-8-sigdef get_config(filepath: str) -> dict: config = configparser.ConfigParser() # uft-8 不需要BOM # "utf-8-sig"读取带有BOM的"utf-8文件 config.read(filepath, encoding='utf-8-sig') items = config._sections items = dict(ite
2021-08-22 19:08:05 3809
原创 ‘LeftMenu‘ cannot be used as a JSX component.
最近刚开始学习react,编写完类组件,使用时发现报错,错误如下:TS2786: 'LeftMenu' cannot be used as a JSX component. Its instance type 'LeftMenu' is not a valid JSX element. Type 'LeftMenu' is missing the following properties from type 'ElementClass': context, setState, forceUpdat
2021-08-17 20:46:02 3290
原创 telegram消息提醒BOT简单使用流程
创建消息提醒机器人进入Telegram APP找到@BotFather输入/start接下来根据英文提示创建自己的Bot1.查找chat_idGET https://api.telegram.org/{botkey}/getUpdates2.安装python版本的telegramAPIpip install python-telegram-bot3.发送信息import telegramdef main(): # 代理请求 proxy = telegram.utils.req
2021-07-28 23:30:19 5023
原创 构建自己的python库
封装自己的库,文件夹需按以下格式├── LICENSE ├── README.md ├── packageName│ ├── __init__.py │ ├── hello.py │ ├── word.py ├── setup.pysetup.pyfrom setuptools import setupsetup( name='example_package', version='0.0.1', packages=['packageName'], i
2021-07-16 22:19:04 200
原创 python配置文件中存储字典(键值对)
yml 文件配置方式DEFAULT: ADMIN: PERSON MESSAGE: 'name': 'hello' 'age': 20python读取配置信息import yamlwith open('config.yml') as f: config = yaml.load(f, Loader=yaml.FullLoader) content = config['DEFAULT']['MESSAGE'] print(co
2021-06-20 16:39:18 508
原创 python打包exe报错:IndexError: tuple index out of range
因为pyinstaller不支持python3.5以上版本,如果不回退版本,可以卸载原有安装包,按下方指令重新安装。pip uninstall pyinstallerpip install https://github.com/pyinstaller/pyinstaller/tarball/develop编译成可执行文件(.exe)pyinstaller -F hello.py...
2021-06-20 15:20:04 1129
原创 js ??和?.的含义
??(空值合并操作符)当左侧值为 null 或 undefined 时,返回 ?? 符号右边的值案例如下:'hello world' ?? 'hi' // 'hello world''' ?? 'hi' // ''false ?? 'hi' // falsenull ?? 'hi' // 'hi'undefined ?? 'hi'// 'hi'?.(可选链操作符)允许读取位于连接对象链深处的属性的值,而不必明确验证链中的每个引用是否有效。案例如下:let ne
2021-06-17 14:19:53 33341 1
原创 npm更换镜像源以及注意事项
// 打开终端npm install -g cnpm --registry=https://registry.npm.taobao.org// 更换镜像源npm config set registry https://registry.npm.taobao.org// 验证是否成功npm config get registry解决部分前端工具无法下载的问题。注意事项1.更换镜像源后vsCode登录会出现“npm login error 500”报错解决办法:// 更换回原来的镜
2021-06-16 14:37:40 377
原创 linux上安装python其他版本
打开终端输入sudoapt-get -q updatesudo apt-get install -ypython3.7sudo apt-get insatll -ypython3.7-distutils打开https://bootstrap.pypa.io/get-pip.py下载到本地终端进入下载文件所在路径,输入:sudo python3 get-pip.py完成!...
2020-12-16 16:12:01 94
原创 python中np.random.choice()的使用方法
官方予以的文档说明:numpy.random.choice(a, size=None, replace=True, p=None)a:输入的如果是一维数组,则从该一维数组中采样,如果是int型,则从0到a-1序列随即采样。size: 表示采样的数量;可以是int型(默认为1)也可以是tuple。如果是tuple,例如(m,n,k),则采样数为mnk,大小为(m,n,k)的数组。repla...
2020-02-21 23:39:41 4313
原创 虚拟环境virtualenv以及virtualenvwrapper的配置
本人系统环境用的是Linux(Ubuntu)virtualenv前提提要:使用Python开发项目时,遇到需要使用不同软件版本的项目时,Virtualenv能创建独立的Python虚拟环境工具,建立多个相互独立,互不影响的Python工作环境。安装打开终端pip3 install virtualenvvirtualenv空格xxx(项目名称)启动:进入虚拟环境的bin目录下,输入s...
2019-10-23 22:48:41 368
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人