摘要: 阅读全文
posted @ 2020-04-10 21:58 linux——quan 阅读(162) 评论(0) 推荐(0) 编辑
摘要: mysql> USE mon Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Datab 阅读全文
posted @ 2020-04-10 21:48 linux——quan 阅读(467) 评论(3) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-04-10 21:46 linux——quan 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 结果 阅读全文
posted @ 2020-04-10 21:45 linux——quan 阅读(168) 评论(0) 推荐(0) 编辑
摘要: t = ("a","b","c",1,2) print(t) print(t[2]) print(t[-1]) print(t[1:4]) print('b' in t) #元组创建后不可变 #写入数据的函数也不支持 #特殊情况,如果元组内持有列表,那么列表的内容是允许被修改的 t2 = (['a' 阅读全文
posted @ 2020-04-10 21:44 linux——quan 阅读(172) 评论(0) 推荐(0) 编辑
摘要: mysql> SHOW DATABASES; + + | Database | + + | information_schema | | m1 | | mon | | mysql | | performance_schema | | quan; | | quanbbs | | quantest | 阅读全文
posted @ 2020-04-10 21:43 linux——quan 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 一定要按照这个顺序,where group by having order by limit 可以进行一次排序之后再一次拍寻 #存储的时候,能存数字就村数字 阅读全文
posted @ 2020-04-10 21:42 linux——quan 阅读(128) 评论(0) 推荐(0) 编辑
摘要: #参数可以设置默认值,如果调用参数的时候没有给出改参数的值,则使用默认值进行调用 def calc_exchange_rate(amt,source,target = "USD"): print(target) if source == "CNY" and target == "USD": resu 阅读全文
posted @ 2020-04-10 21:41 linux——quan 阅读(233) 评论(0) 推荐(0) 编辑
摘要: win +R d 阅读全文
posted @ 2020-04-10 21:40 linux——quan 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-04-10 21:39 linux——quan 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 进行自定义包调用的时候 如果将包视为文件夹,可以直接通过 from work(报名字) import toos(包里面的文件名) 然后再通过 toos.gen_trans_id()(文件里面的函数名字)调用 这种情况不能通过import work调用 如果要通过import work直接调用,wor 阅读全文
posted @ 2020-04-10 21:38 linux——quan 阅读(248) 评论(0) 推荐(0) 编辑
摘要: pip install virtualenv 安装虚拟环境工具 -win是指win版本 mkvirtualenv venv 创建虚拟环境 workon 查看当前的虚拟环境目录 workon django1.11 切换到虚拟环境 deactivate 退出虚拟环境 rmvirtualenv djang 阅读全文
posted @ 2020-04-10 21:37 linux——quan 阅读(134) 评论(0) 推荐(0) 编辑
摘要: def use_filer(l): """ 获取指定列表/元组中的奇数 :param l: lsit/tuple :return: """ rest = filter(lambda n:n % 2 != 0,l) return rest if __name__ == '__main__': l = 阅读全文
posted @ 2020-04-10 21:36 linux——quan 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 将文件的打开和关闭,交给上下文管理工具with去实现。 def read_file(): """ 读取文件 :return: """ file_path1 = 'D:\\PycharmProjects\\p1\\text.txt' file_path2 = 'D:/PycharmProjects/p 阅读全文
posted @ 2020-04-10 21:35 linux——quan 阅读(664) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-04-10 21:33 linux——quan 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 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) 编辑