摘要:
from threading import Thread import os class InputData(object): def read(self): raise NotImplementedError class PathInputData(InputData): def __init__ 阅读全文
摘要:
在字典中查找某个值时,若key不存在时则会返回一个KeyError错误而不是一个默认值,这时候可以使用defaultdict函数。 注意:使用dict[key]=value时,若key不存在则报错;使用dict.get(key)时,若key不存在则会返回一个默认值。 defaultdict接受一个工 阅读全文
摘要:
https://github.com/bslatkin/effectivepython/find/master 阅读全文
摘要:
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-% 阅读全文
摘要:
# 取别名方法一 a1 = Book.objects.filter().extra(select={'title2': 'title', 'category2': 'category'}).values("title2", "category2") print('这是a1',a1) # 取别名方二 阅读全文
摘要:
https://blog.csdn.net/qiqiyingse/article/details/117422118 阅读全文
摘要:
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 阅读全文
摘要:
#_*_ 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 # 阅读全文
摘要:
https://blog.csdn.net/ybdesire/article/details/42145597 阅读全文