摘要:
def memoize(fn): stored_results = {} @functools.wrap(fn) def memoized(*args): try: # try to get the cached result return stored_results[args] except K 阅读全文
摘要:
1)列表逆序,字符串逆序l[::-1] l.reverse() #list2)三元操作符x if x>y else y(x>y and [x] or [y])[0]3)阶乘f=lambda n:reduce(lambda x,y:x*y,range(1,n+1))4)sort,sortedsorte 阅读全文
摘要:
一、修改口令mysqladmin -u root password "newpass"mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');mysql> use mysql;mysql> UPDATE user SET Password = PASSWORD('newpass') WHERE user = 'root';mysql> FLUSH PRIVILEGES;忘记root口令#/opt/r 阅读全文
摘要:
一、import logginglogging.basicConfig(filename='...',level=logging.DEBUG)#filename Specifies that a FileHandler be created, using the specified filenam... 阅读全文