随笔分类 - python
摘要:参考链接 Python 3.x | 史上最详解的 导入(import) 解决python3中关于import的疑难杂症
阅读全文
摘要:0x00 staticmethod和classmethod区别 class A(object): def foo(self, x): print(f"executing foo({self}, {x})") @classmethod def class_foo(cls, x): print(f"ex
阅读全文
摘要:1. 易混淆操作 本节对一些 Python 易混淆的操作进行对比。 1.1 有放回随机采样和无放回随机采样 import randomrandom.choices(seq, k=1) # 长度为k的list,有放回采样random.sample(seq, k) # 长度为k的list,无放回采样 1
阅读全文
浙公网安备 33010602011771号