上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 32 下一页
摘要: self 表示类里面的对象的引用 python一般不需要去解决内存管理,解释器会进行自动给回收 #类鱼类之间空格两行,前面的函数里面也是两行,类里面的方法个一行 class Cat(object): """ 猫科动物 """ def __init__(self,name,age,sex=None): 阅读全文
posted @ 2020-04-10 21:32 linux——quan 阅读(234) 评论(0) 推荐(0) 编辑
摘要: def hello(): print("hello") def test(): print("test") def hello_wrapper(): print("aaa") hello() print("bbbb") def test_wrapper(): print("aaaa") hello( 阅读全文
posted @ 2020-04-10 21:31 linux——quan 阅读(178) 评论(0) 推荐(0) 编辑
摘要: def test_div(num1,num2): return num1 / num2 if __name__ == "__main__": try: print(test_div(5,"a")) except ZeroDivisionError: print("除数不能为零") except Ty 阅读全文
posted @ 2020-04-10 21:30 linux——quan 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 恢复内容开始 python实现实现实现实现 import re #将表达式编译,返回一个对象, pattern = re.compile(r"hello",re.I)#re.I忽略大小写 print(dir(pattern)) #使用对象的方法,通过match匹配 rest = pattern.ma 阅读全文
posted @ 2020-04-10 21:29 linux——quan 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 333333333333333333333333333 mysql> DESC user; + + + + + + + | Field | Type | Null | Key | Default | Extra | + + + + + + + | id | int(11) | NO | PRI | 阅读全文
posted @ 2020-04-10 21:28 linux——quan 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 666666666666666666666666 如多带有通配符的,要使用一下格式 select * from user where usename like "%1\%" ESCAPE 1; 再通配符前面使用1 后面加上ESCAPE告诉1 是不用解析的 注意:上面的FOWER是错的,改为POWER 阅读全文
posted @ 2020-04-10 21:27 linux——quan 阅读(254) 评论(0) 推荐(0) 编辑
摘要: python对于I/O密集型应用比较好,具体根据是什么类型应用来查看 对于cpu密集型应用可以借助python的一些扩展去实现 thread模块是比较早期的模块,thresding是比较新的模块,对thread模块进行了新的封装, import threading def loop(): """新线 阅读全文
posted @ 2020-04-10 21:26 linux——quan 阅读(238) 评论(0) 推荐(0) 编辑
摘要: import os import time from multiprocessing.dummy import Process def so_sth(name): print("进程名称{},{}".format(name, os.getpid())) time.sleep(5) print("进程 阅读全文
posted @ 2020-04-10 21:25 linux——quan 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-04-10 21:24 linux——quan 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 1.网页登录百度网盘:https://pan.baidu.com/2.百度输入法生成:http://pcs.baidu.com/rest/2.0/pcs/file?app_id=265486&method=list&path=%2F打开这个链接会提示错误,不用管,此步会在你的网盘我的应用数据目录下生 阅读全文
posted @ 2020-04-10 21:23 linux——quan 阅读(2170) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 32 下一页