![](https://img-blog.csdnimg.cn/20210216234335393.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
Python
Python相关
bug404_
女程序猿,计算机视觉方向,主要关注transformer、视觉、深度学习框架、模型压缩和部署相关的内容。
展开
-
vscode给python添加头部注释模板
FIle -> Preference -> User Snippets -> 选择python文件 把内容替换成 { // Place your snippets for python here. Each snippet is defined under a snippet name and has a prefix, body and // description. The prefix is what is used to trigger the snippet and th原创 2021-03-20 14:30:28 · 1226 阅读 · 0 评论 -
@functools.lru_cache(maxsize=128, typed=False)缓存到底有什么用
今天来谈一谈@functools.lru_cache(maxsize=128, typed=False)缓存装饰器,这是在Python3.2版本中新添加的功能,意在将重复耗时的计算的中间结果保存下来,如无缓存的递归运算。lru 是(least recently used)的缩写,即最近最少使用原则。表明缓存不会无限制增长,一段时间不用的缓存条目会被扔掉。 maxsize 是保存最近多少个调用的结果,最好设置为 2 的倍数,默认为 128。如果设置为 None 的话就相当于是 maxsize 为正无穷了。还有原创 2021-02-26 20:50:44 · 1046 阅读 · 1 评论 -
Python | 用Python制作送给女票的生日礼物
视频演示:https://www.bilibili.com/video/BV1R7411C7A1 代码地址:https://github.com/borninfreedom/HappyBirthday 截图:原创 2020-03-27 11:30:54 · 8903 阅读 · 0 评论 -
Python | 全网最简单方式把Python文件打包为exe
auto-py-to-exe是一个将.py转换为.exe的可视化窗口程序,安装这个程序时会自动安装pyinstaller所需要的运行时依赖文件,通过点击不同的按钮实现不同的pyinstaller指令。 相比于pyinstaller,这个 程序不用去记多种指令。 本人在对同一份代码打包的时候发现,pyinstaller会出现"maxmium recursion exceed"等错误,但是aut...原创 2020-03-26 13:46:10 · 1235 阅读 · 0 评论