python
aliu_rui
本人是一个本科的大三学生
展开
-
Python--re模块的findall等用法
https://www.cnblogs.com/syw20170419/p/9749809.html转载 2020-02-06 18:13:41 · 220 阅读 · 0 评论 -
Python 通过字符串调用类方法或方法
https://blog.csdn.net/GodLordGee/article/details/89086963转载 2020-02-05 18:15:53 · 614 阅读 · 1 评论 -
python中采用中文注释
枯竭和原创 2018-07-25 09:57:17 · 275 阅读 · 0 评论 -
Python单步调试
起步运行python -m pdb test.py(Pdb) 会自动停在第一行,等待调试,这时你可以看看帮助(Pdb) h常用命令断点调试(Pdb)b 10 #断点设置在本py的第10行或(Pdb)b ots.py:20 #断点设置到 ots.py第20行删除断点(Pdb)b #查看断点编号(Pdb)cl 2 #删除第2个断点运行(Pdb)n #...原创 2018-07-27 10:58:18 · 449 阅读 · 0 评论 -
Python中*和**的区别
Python中,(*)会把接收到的参数形成一个元组,而(**)则会把接收到的参数存入一个字典我们可以看到,foo方法可以接收任意长度的参数,并把它们存入一个元组中>>> def foo(*args):... print(args)...>>> foo("fruit", "animal", "human")('fruit', 'anim..原创 2018-08-14 10:48:16 · 182 阅读 · 0 评论 -
Python 的 setitem、getitem、delitem 方法使用
简介setitem:当属性被以索引方式赋值的时候会调用该方法getitem:一般如果想使用索引访问元素时,就可以在类中定义这个方法delitem:当使用索引删除属性时调用该方法 实例__Author__ = "Aliu#"# -*- coding = utf-8 -*-class Point: def __init__(self): ...原创 2018-08-15 17:33:23 · 1239 阅读 · 1 评论