
python
遇见更好的自己~
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
staticmethod 和 classmethod 的适用场景
参考链接:https://www.cnblogs.com/hello-/articles/8177836.html转载 2020-11-20 18:12:08 · 189 阅读 · 0 评论 -
python中的驻留机制
a = 1 b = 1 print(a is b) c = 1000 d = 1000 print(c is d) print(id([1])==id([1])) print(id([1])==id([2,3])) x = 'hello' y = 'hello' print(x is y) x1 = 'hello world' y1 = 'hello world' print(x1 is y1) 在py文件运行上面代码都是True,在交互式输入执行: >>> c = 1000 &原创 2020-11-20 16:24:18 · 257 阅读 · 0 评论 -
python的with用法
原文链接:http://blog.kissdata.com/2014/05/23/python-with.html转载 2020-11-19 22:30:57 · 93 阅读 · 0 评论 -
python之json和dict转换
import json dict = {'id':1, 'name':'alan', 'sex':'man'} # dict_to_json json_data = json.dumps(dict) # json_to_dict dict_data = json.loads(json_data) # 字典转json然后写入到文件,文件不存在自动创建 with open('a.json', 'w') as f: json.dump(dict, f) # 读取json文件转换为dict wit原创 2020-11-18 17:04:07 · 359 阅读 · 0 评论 -
python单链表的一些操作
```python class Node(object): def __init__(self, data): ''' data:数据 next:指向下一个节点 ''' self.data = data self.next = None class Single_LinkList(obje...原创 2019-11-21 23:24:28 · 145 阅读 · 0 评论