- 面向对象的三个属性: 封装:把功能显示出来,隐藏具体实现代码 继承:python支持多继承 多态:不同的人,对同一事物的不同看法 方法:类的一部分,对象调用的函数 函数:可以直接用函数名调用的代码块 装饰器: @classmethod :调用的时... 面向对象的三个属性: 封装:把功能显示出来,隐藏具体实现代码 继承:python支持多继承 多态:不同的人,对同一事物的不同看法 方法:类的一部分,对象调用的函数 函数:可以直接用函数名调用的代码块 装饰器: @classmethod :调用的时...
- 需要在Nuget安装IronPython, 如果报错,需要更新Nuget版本则下载对应版本即可:https://dist.nuget.org/index.html 添加引用:IronPython.dll,Microsoft.Scripting.dll(在IronPython的安装目录中) c#文件:... 需要在Nuget安装IronPython, 如果报错,需要更新Nuget版本则下载对应版本即可:https://dist.nuget.org/index.html 添加引用:IronPython.dll,Microsoft.Scripting.dll(在IronPython的安装目录中) c#文件:...
- 进制转换的函数 bin() 10进制转2进制oct() 10进制转8进制hex()10进制转16进制int() *进制转10进制 各进制之间转换 ↓2进制8进制10进制16进制2进制-bin(int(x, 8))bin(int(x, 10))bin(int(x, 16))8进制oct(int(x, 2))-oct(int(x, 10))oct(int(x, 16)... 进制转换的函数 bin() 10进制转2进制oct() 10进制转8进制hex()10进制转16进制int() *进制转10进制 各进制之间转换 ↓2进制8进制10进制16进制2进制-bin(int(x, 8))bin(int(x, 10))bin(int(x, 16))8进制oct(int(x, 2))-oct(int(x, 10))oct(int(x, 16)...
- 操作目录及文件 import shutil f1 = open("file.txt", "r", encoding="utf-8") f2 = open("file_new.txt", "w", encoding="utf-8") shutil.copyfileobj(f1, f2) # 通过文件对象拷贝文件内容 shutil.copyfile("file.tx... 操作目录及文件 import shutil f1 = open("file.txt", "r", encoding="utf-8") f2 = open("file_new.txt", "w", encoding="utf-8") shutil.copyfileobj(f1, f2) # 通过文件对象拷贝文件内容 shutil.copyfile("file.tx...
- 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(...
上滑加载中
推荐直播
-
华为云码道Agent集成与鸿蒙实战2026/08/11 周二 19:00-21:00
王一男-华为云码道产品规划专家;李炎-华为云码道产品专家;彭江敏-华为云鸿蒙端云一体化开发专家
本次直播带你解读华为云码道7月份产品新特性、新功能。更有专家演示码道Agent Space × 钉钉机器集成实战,从0到1打通消息通道;码道鸿蒙端云一体化实战,快速搭建员工签到系统。
回顾中 -
华为云开发者AI素养直播课·第五期2026/09/04 周五 16:00-18:00
林华鼎-华为云AI开发者运营负责人;蒋春阳-华为云AI开发者案例开发专家
本期直播内容: AI工具体验营 · 第5-8课连讲。Agent-Team 多智能体协作完成毕业设计实践
回顾中 -
华为云开发者AI素养ClassRoom·第六期2026/09/08 周二 19:00-20:00
樊渊-2026华为软件挑战赛冠军
高手来了:看软挑高手解析二维排样问题—从工业难题到算法突破
回顾中
热门标签