摘要: class Person(object): def __init__(self, age): self.age = age @property def age(self): print('i am the get age of Person ...') return self._age @age.s 阅读全文
posted @ 2020-07-14 14:47 turbolxq 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 安装依赖:xampp、mysql、testlink 一、xampp安装(参考:https://blog.csdn.net/it_cgq/article/details/79430511) 1、下载xampp完成之后安装 2、配置 a.command+空格搜索:/private/etc,在hosts文 阅读全文
posted @ 2020-07-13 17:02 turbolxq 阅读(800) 评论(0) 推荐(0) 编辑
摘要: 参考文档:https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Promise#%E6%96%B9%E6%B3%95 1、promise实现异步调用 <!DOCTYPE html> <head 阅读全文
posted @ 2020-01-14 10:29 turbolxq 阅读(111) 评论(0) 推荐(0) 编辑
摘要: def test(a): try: print('this is try...') if a == 0: raise ZeroDivisionError('customize erro') # 如果try有return则不再执行else的代码 return str(10/a) # 多个except之 阅读全文
posted @ 2020-01-02 14:40 turbolxq 阅读(383) 评论(0) 推荐(0) 编辑
摘要: # lambda,filter,map,reduce from functools import reduce print('返回一个迭代器') print((x) for x in range(5)) print('迭代器转换为tuple') print(tuple((x) for x in ra 阅读全文
posted @ 2019-12-31 14:31 turbolxq 阅读(459) 评论(0) 推荐(0) 编辑
摘要: 参考:https://www.runoob.com/python/python-reg-expressions.html 整理所得。 一、 march, search, findall, sub的区别 import re s = 'xx,Hello World Wide web, helloPyth 阅读全文
posted @ 2019-11-20 14:24 turbolxq 阅读(281) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/python # -*- coding: UTF-8 -*- # 父类 class JustCounter: ''' 类变量:类变量在整个实例化的对象中是公用的。类变量定义在类中且在函数体之外。类型:私有变量、保护变量、公开变量的调用方式。 私有变量:两个下划线开头,声明该属性 阅读全文
posted @ 2019-11-18 17:13 turbolxq 阅读(4820) 评论(0) 推荐(2) 编辑
摘要: 钉钉官方文档:https://ding-doc.dingtalk.com/doc#/serverapi2/qf2nxq 阅读全文
posted @ 2019-10-29 18:23 turbolxq 阅读(3820) 评论(0) 推荐(0) 编辑
摘要: 闭包:当有函数嵌套时,内部函数被保存到外部时会产生闭包。 def A(): # print('this is A function') a = 0 def B(): # B里面的参数a是声明在B函数外的,所以要修改a的值需要先执行nonlocal a nonlocal a a += 1 print( 阅读全文
posted @ 2019-03-23 21:57 turbolxq 阅读(120) 评论(0) 推荐(0) 编辑
摘要: import json result = [] def NBFS(dict_str:dict,target_list:[str]) -> [str]: ''' 输入dict类型的数据,已经对应的key,返回[str] ''' x = '' try: for i in range(len(target 阅读全文
posted @ 2019-03-06 23:24 turbolxq 阅读(132) 评论(0) 推荐(0) 编辑