上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 44 下一页
摘要: from threading import Thread import os class InputData(object): def read(self): raise NotImplementedError class PathInputData(InputData): def __init__ 阅读全文
posted @ 2022-08-12 23:52 ty1539 阅读(26) 评论(0) 推荐(0) 编辑
摘要: 在字典中查找某个值时,若key不存在时则会返回一个KeyError错误而不是一个默认值,这时候可以使用defaultdict函数。 注意:使用dict[key]=value时,若key不存在则报错;使用dict.get(key)时,若key不存在则会返回一个默认值。 defaultdict接受一个工 阅读全文
posted @ 2022-08-07 20:32 ty1539 阅读(519) 评论(0) 推荐(0) 编辑
摘要: https://github.com/bslatkin/effectivepython/find/master 阅读全文
posted @ 2022-08-05 23:13 ty1539 阅读(32) 评论(0) 推荐(0) 编辑
摘要: import datetime t1 = datetime.datetime.strptime("2017-9-06 10:30:00", "%Y-%m-%d %H:%M:%S") t2 = datetime.datetime.strptime("2017-9-06 12:30:00", "%Y-% 阅读全文
posted @ 2022-08-05 17:03 ty1539 阅读(2434) 评论(0) 推荐(0) 编辑
摘要: # 取别名方法一 a1 = Book.objects.filter().extra(select={'title2': 'title', 'category2': 'category'}).values("title2", "category2") print('这是a1',a1) # 取别名方二 阅读全文
posted @ 2022-08-02 23:36 ty1539 阅读(587) 评论(0) 推荐(0) 编辑
摘要: https://blog.csdn.net/qiqiyingse/article/details/117422118 阅读全文
posted @ 2022-07-19 10:53 ty1539 阅读(40) 评论(0) 推荐(0) 编辑
摘要: import abc class Foo(metaclass=abc.ABCMeta): def f1(self): print(123) @abc.abstractmethod def f2(self):pass class Bar(Foo): def f2(self): print(666) o 阅读全文
posted @ 2022-07-18 23:56 ty1539 阅读(18) 评论(0) 推荐(0) 编辑
摘要: #_*_ encoding: utf-8 _*_ @author: ty hery 2019/7/17 import sys import inspect class testsqawd(object): def hello(self): print('the name of method is # 阅读全文
posted @ 2022-07-18 23:31 ty1539 阅读(21) 评论(0) 推荐(0) 编辑
摘要: https://blog.csdn.net/ybdesire/article/details/42145597 阅读全文
posted @ 2022-07-14 10:44 ty1539 阅读(15) 评论(0) 推荐(0) 编辑
摘要: from django.test import TestCase # Create your tests here. # Python模块 # 模块就是一个保存了Python代码的文件,模块能定义函数,类和变量,模块里也能包含可执行的代码 # # Python模块的导入 # Import 语句 # 阅读全文
posted @ 2022-07-01 00:01 ty1539 阅读(18) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 44 下一页