Py之utils:utils库的简介、安装、使用方法之详细攻略

简介: Py之utils:utils库的简介、安装、使用方法之详细攻略


目录

utils库的简介

utils库的安装

utils库的使用方法

1、基础用法


 

 

 

 

utils库的简介

         有时你会一遍又一遍地写一个函数;有时你会抬头看天花板,问“为什么,Guido,为什么标准库不包括这个?”“嗯,我们也许不能回答这个问题。但是我们可以把这些功能集中到一个地方!

 

 

utils库的安装

pip install utils

 

utils库的使用方法

1、基础用法

1. from utils import enum
2. 
3. class Colors(enum.Enum):
4.     RED = 0
5.     GREEN = 1
6. 
7. # Defining an Enum class allows you to specify a few
8. # things about the way it's going to behave.
9. class Options:
10.         frozen = True # can't change attributes
11.         strict = True # can only compare to itself; i.e., Colors.RED == Animals.COW
12. # will raise an exception.
13. 
14. # or use the enum factory (no Options, though)
15. ColorsAlso = enum.enum("RED", "GREEN")


目录
打赏
0
0
0
0
1043
分享
相关文章
|
9月前
|
edac-utils工具如何使用
【6月更文挑战第1天】edac-utils工具如何使用
424 3

热门文章

最新文章

AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等