python小知识
0 人感兴趣 · 35 次引用
- 最新
- 推荐

python 游戏开发 -pgzero
pgzero(pygame zero)是在pygame基础上做了进一步的封装,使得设计一款游戏十分的方便,特别适合少儿编程领域的教学, 与scratch相得益彰

用纯 python 写 web app:Streamlit
一句话,Streamlit是一个可以用python编写web app的库,可以方便的动态展示你的机器学习的项目。
python 中对象引用 | python 小知识
引用在各种编程语言中都有涉及,如java中值传递和引用传递。python的对象引用也是学习python过程中需要特别关注的一个知识点,特别是对函数参数传递,可能会引起不必要的BUG。本文将对引用做一个梳理,内容涉及如下:


python 统计程序耗时 | python 小知识
我们在做性能分析的时候,最常用的方法就是统计程序的耗时;通过分析耗时,来确定需要优化和改进的部分。


如何管理你的 python 包 | python 小知识
python的包都存放PyPI中,PyPI即Python Package Index,是python的软件仓库。所有的python包都可以在PyPI中下载并安装
如何锁住文件 | python 小知识
在程序开发中,当所需资源遭到争抢的时候,通常用锁来保证数据的一致性。应用场景如如数据库,各个进程需要保证它正在单独地写一个文件,这时就要用到文件锁。

python 小知识 - 内置方法和属性应用:反射和单例
python除了丰富的第三方库外,本身也提供了一些内在的方法和底层的一些属性,大家比较常用的如dict、list、set、min、max、range、sorted等。笔者最近在做项目框架时涉及到一些不是很常用的方法和属性,在本文中和大家做下分享。

python 小知识 -hook 函数
经常会听到钩子函数(hook function)这个概念,最近在看目标检测开源框架mmdetection,里面也出现大量Hook的编程方式,那到底什么是hook?hook的作用是什么?

python 小知识 - 模块
在《失控》中提到一个几千万行的程序(操作系统)要想没有bug是很难,减少bug的解决方案就是不断的拆分功能项,直到不能拆分为止,只要保证拆分的最小功能项通过一定的单元测试,就可能消费bug(当然还有集成性和系统性的bug)。《失控》里说的就是现代软件工

python 小知识 -python 文件操作
在程序的世界中,数据是以文件的形式存储中,通常会以一定的目录结构进行组织。程序开发即是数据处理,所以文件操作是语言开发的必备功能。



python 小知识 - 日志处理 logging
在项目开发中,日志信息是程序中必不可少的组成部分。每一种语言都有相应的日志模块,如java中log4j,而python中是通过logging模块来提供日志功能。

python 小知识 - 命令行参数处理之 argparse
argparse提供了灵活的命令行参数处理,在日常功能开发中有着重要作用。

python 小知识 -python 格式化
打印输出是每一种语言都必有的函数,虽然也有断电调试,但是打印输出自认为是最好的调试手段,哪里有问题,哪里打印出来。

python 小知识 - 如何判断一个对象为空值
我们在开发过程中经常会遇到判断一个对象是否是空值的情况,以便于对于空值情况做一些特殊的处理或者异常判断。那什么是空值?

python 小知识 - 什么是上下文管理
with是一种python上下文管理方式;什么是上下文(context)context是指程序运行所处于的环境和自身的状态(如数据)

python 小知识 -rethinking python 生成器
前面我们分享过python迭代器,这里要说的生成器是一种特殊的迭代器。 普通的迭代器的迭代对象是完全加载到内存中;而生成器的迭代对象不是一次性生成好的,而是迭代对象使用的时候才具体生成。