Python
iulmt
这个作者很懒,什么都没留下…
展开
-
【算法日练】欧拉项目 Problem 1
第一题地址 题目描述 If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000. 3或5的倍数 在小于的自然数中,或的倍数有、、和,这些数之和是。 求小于的自然数中所有或的倍数之和。 分析 求10原创 2022-03-11 14:40:08 · 158 阅读 · 0 评论 -
【Python】借助实现可排序类记录下Python的Magic方法使用
实现Python的Magic方法可以实现很多神奇的功能 import time class SortedObj(object): """ 借助实现一个可排序类,讲讲python的magic方法 """ def __init__(self): """初始化方法""" self.__created_at__ = time.time() def __lt__(self, other: "SortedObj"): """原创 2022-03-09 16:44:36 · 355 阅读 · 0 评论 -
【Python】照片扩展信息提取
扩展信息注解 EXIF 标识 ExifVersion Exif 版本 FlashPixVersion FlashPix 版本 ColorSpace 色域、色彩空间 PixelXDimension 图像的有效宽度 PixelYDimension 图像的有效高度 ComponentsConfiguration 图像构造 CompressedBitsPerPixel 压缩时每像素色彩位 MakerNote 制造商设置的信息 UserComment 用户评论 RelatedSoundFile 关联的声音文件 D原创 2022-03-08 14:12:43 · 654 阅读 · 0 评论 -
【Python】Conda部分命令记录
Miniconda 下载地址 清华源下载地址 新建虚拟环境 conda create -n 新环境名称 python=3.6 激活虚拟环境 conda activate 环境名称 退出虚拟环境 conda deactivate 删除虚拟环境 conda remove -n 环境名称 --all 更新 conda conda update -n base conda 列出已经存在的环境列表 conda env list ...原创 2022-03-07 11:18:08 · 931 阅读 · 0 评论 -
【Python】好记性不如烂笔头,我的代码笔记本
函数体内部获取自己的函数名称 import sys def demo(): func_name = sys._getframe().f_code.co_name print(func_name) # -> demo 去掉requests使用verify=False时出现的警告 import requests from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.原创 2022-03-07 10:37:56 · 326 阅读 · 0 评论 -
【Python】Elasticsearch 常规用操作封装
Python依赖 elasticsearch==7.10.0 使用方法简述 from elasticsearch import Elasticsearch from es_helper import DefaultEsHelper, Q, Sort, ESPagination, Update ES_INSTANCE = Elasticsearch() ES_HELPER = DefaultEsHelper(ES_INSTANCE) # 判断字段是否存在 q = Q.filter('exists'原创 2022-03-02 18:11:29 · 1967 阅读 · 2 评论