- Flask-Static-Digest 用于处理静态文件 文档:https://github.com/nickjj/flask-static-digest 安装 pip install Flask-Static-Digest 1 使用示例 # -*- coding: utf-8 -*- from flask import Flask, render_temp... Flask-Static-Digest 用于处理静态文件 文档:https://github.com/nickjj/flask-static-digest 安装 pip install Flask-Static-Digest 1 使用示例 # -*- coding: utf-8 -*- from flask import Flask, render_temp...
- 通过一个判断文件是否存在,判断实例是否存在 # -*- coding: utf-8 -*- import atexit import os @atexit.register def remove_lock_file(): if os.path.exists('file.lock'): os.remove('file.lock') def create_loc... 通过一个判断文件是否存在,判断实例是否存在 # -*- coding: utf-8 -*- import atexit import os @atexit.register def remove_lock_file(): if os.path.exists('file.lock'): os.remove('file.lock') def create_loc...
- 文档:https://github.com/pallets/itsdangerous 安装 pip install itsdangerous 1 示例 # -*- coding: utf-8 -*- from itsdangerous import TimedJSONWebSignatureSerializer # jwt auth_s = TimedJSON... 文档:https://github.com/pallets/itsdangerous 安装 pip install itsdangerous 1 示例 # -*- coding: utf-8 -*- from itsdangerous import TimedJSONWebSignatureSerializer # jwt auth_s = TimedJSON...
- 文档:https://github.com/scrapinghub/price-parser 安装 pip install price-parser 1 requires Python 3.6+. # -*- coding: utf-8 -*- from price_parser import parse_price price = parse_price(... 文档:https://github.com/scrapinghub/price-parser 安装 pip install price-parser 1 requires Python 3.6+. # -*- coding: utf-8 -*- from price_parser import parse_price price = parse_price(...
- 首先理解一下几个概念 笔记本 Python版本2.7 Python版本3.6 ... 首先理解一下几个概念 笔记本 Python版本2.7 Python版本3.6 ...
- Counter计数器,继承了dict类,基本可以和字典的操作一样 from collections import Counter # 实例化 counter = Counter("abcabcccaaabbb") print(counter) # Counter({'a': 5, 'b': 5, 'c': 4}) # 数量最多的2个 print(counter.m... Counter计数器,继承了dict类,基本可以和字典的操作一样 from collections import Counter # 实例化 counter = Counter("abcabcccaaabbb") print(counter) # Counter({'a': 5, 'b': 5, 'c': 4}) # 数量最多的2个 print(counter.m...
- TinyDB 是一个轻量级的文档数据库,操作类似MongoBD,其存储方式为Json 文档:https://tinydb.readthedocs.io/en/latest/index.html github:https://github.com/msiemens/tinydb 代码示例 # -*- coding: utf-8 -*- from tinydb im... TinyDB 是一个轻量级的文档数据库,操作类似MongoBD,其存储方式为Json 文档:https://tinydb.readthedocs.io/en/latest/index.html github:https://github.com/msiemens/tinydb 代码示例 # -*- coding: utf-8 -*- from tinydb im...
- 开启文件服务器 # python2 python -m SimpleHTTPServer # python3 python3 -m http.server # 指定端口,默认8000 python3 -m http.server 8080 # 指定ip python3 -m http.server 8080 --bind 127.0.0.1 # 指定目录 py... 开启文件服务器 # python2 python -m SimpleHTTPServer # python3 python3 -m http.server # 指定端口,默认8000 python3 -m http.server 8080 # 指定ip python3 -m http.server 8080 --bind 127.0.0.1 # 指定目录 py...
- python的管理工具太多了,是谁说的python解决一个问题只用一个方式来着? 工具介绍原理参考pip包管理工具文章virtualenv虚拟环境管理工具切换目录文章virtualenvwrapper虚拟环境管理工具加强版文章pyenvpython版本管理工具修改环境变量文章pyenv-virtualenv虚拟环境管理工具文章pipenv项目环境管理工具文章pipxP... python的管理工具太多了,是谁说的python解决一个问题只用一个方式来着? 工具介绍原理参考pip包管理工具文章virtualenv虚拟环境管理工具切换目录文章virtualenvwrapper虚拟环境管理工具加强版文章pyenvpython版本管理工具修改环境变量文章pyenv-virtualenv虚拟环境管理工具文章pipenv项目环境管理工具文章pipxP...
- numpy.random随机函数 rand(d0, d1,...dn) 随机数组, 浮点数,[0, 1)均匀分布 randn(d0, d1,...dn) 随机数组,正态分布 randint(low, high, shape) 指定随机范围 seed(s) 随机种子 shuffle(a) 随机排列第一轴, 改变数组a permutation(a) 根据第一轴返回乱序数组... numpy.random随机函数 rand(d0, d1,...dn) 随机数组, 浮点数,[0, 1)均匀分布 randn(d0, d1,...dn) 随机数组,正态分布 randint(low, high, shape) 指定随机范围 seed(s) 随机种子 shuffle(a) 随机排列第一轴, 改变数组a permutation(a) 根据第一轴返回乱序数组...
- 算法Algorithm 一个计算过程,解决问题的方法 递归: 调用自身结束条件 时间复杂度: 用来估计算法运行时间的一个式子 O(1) < O(logn) < O(n) < O(nlogn) < O(n^2) < O(n2logn) < O(n^3)一般来说,时间复杂度高的算法比复杂度低的算法慢不常见的时间复杂度: O(... 算法Algorithm 一个计算过程,解决问题的方法 递归: 调用自身结束条件 时间复杂度: 用来估计算法运行时间的一个式子 O(1) < O(logn) < O(n) < O(nlogn) < O(n^2) < O(n2logn) < O(n^3)一般来说,时间复杂度高的算法比复杂度低的算法慢不常见的时间复杂度: O(...
- Key and Imports In this cheat sheet, we use the following shorthand: df | Any pandas DataFrame object s | Any pandas Series object You’ll also need to perform the following imports t... Key and Imports In this cheat sheet, we use the following shorthand: df | Any pandas DataFrame object s | Any pandas Series object You’ll also need to perform the following imports t...
- 说明: render是get方式 execute是post方式 render import requests def splash_render(url): splash_url = "http://localhost:8050/render.html" args = { "url": url, "timeout": 5, "image": 0, "proxy":... 说明: render是get方式 execute是post方式 render import requests def splash_render(url): splash_url = "http://localhost:8050/render.html" args = { "url": url, "timeout": 5, "image": 0, "proxy":...
- Pony is an advanced object-relational mapper 文档: PyPI: https://pypi.org/project/pony/Github: https://github.com/ponyorm/ponydoc: https://docs.ponyorm.org/ 安装 pip install pony 1 代码实例... Pony is an advanced object-relational mapper 文档: PyPI: https://pypi.org/project/pony/Github: https://github.com/ponyorm/ponydoc: https://docs.ponyorm.org/ 安装 pip install pony 1 代码实例...
- 原理: 1个进程 -> 多个子进程 -> scrapy进程1 代码示例 将以下代码文件放入scrapy项目中任意位置即可 # -*- coding: utf-8 -*- # @File : run_spider.py # @Date : 2018-08-06 # @Author : Peng Shiyu from multiprocessing... 原理: 1个进程 -> 多个子进程 -> scrapy进程1 代码示例 将以下代码文件放入scrapy项目中任意位置即可 # -*- coding: utf-8 -*- # @File : run_spider.py # @Date : 2018-08-06 # @Author : Peng Shiyu from multiprocessing...
上滑加载中
推荐直播
-
华为云码道 × 仓颉编程:工程化AI编码探索2026/05/27 周三 19:00-21:00
刘俊杰-华为云仓颉语言专家/李炎-华为云码道技术专家/王智鹏-OpenCangjie开源社区发起人
本场直播围绕华为云仓颉语言与华为云码道的深度结合,展示华为云智能编程从零基础到高效落地的完整生态能力。以华为云码道为引擎,仓颉语言为载体,带给大家日常提效、趣味创新到极速量产的开发体验。
回顾中
热门标签