12 2018 档案

摘要:这题其实是有难度的,要是不看答案,能把这个小需求实现吗。连这个都实现不了,还想做开发??? 阅读全文
posted @ 2018-12-31 00:11 sunnybowen 阅读(585) 评论(0) 推荐(0) 编辑
摘要:#-*-coding:utf-8-*- ''' 统计用户输入的字符串中有几个数字 ''' # numList = ['0','1','2','3','4','5','6','7','8','9'] s = input('请输入字符串:') count = 0 for i in s: if i in numList: count +=1 print(count) 阅读全文
posted @ 2018-12-30 23:52 sunnybowen 阅读(2458) 评论(0) 推荐(0) 编辑
摘要:#-*-coding:utf-8-*- ''' ''' # 返回二进制的位数 i = 1 a = 2 b = 3 print(i.bit_length()) print(a.bit_length()) print(b.bit_length()) 阅读全文
posted @ 2018-12-30 16:25 sunnybowen 阅读(3811) 评论(0) 推荐(0) 编辑
摘要:#-*-coding:utf-8-*- ''' ''' print(2>1 and 11 and 16 or 2<4 and 3<2) # True print(1 or 2) # 1 print(0 or 2) # 2 print(2 or 3) # 2 print(3 or 2) # 3 print(3 or 0) # 3 print(5 or 100 or 12 or 9) # 5 pr... 阅读全文
posted @ 2018-12-29 20:16 sunnybowen 阅读(142) 评论(0) 推荐(0) 编辑
摘要:二、 三次登录程序优化 这是对昨天的那个while程序的优化。输入三次错误的。最后不管是输入Y还是N,都会弹出fuck you 阅读全文
posted @ 2018-12-29 19:12 sunnybowen 阅读(232) 评论(0) 推荐(0) 编辑
摘要:1 安装,依次执行下面的命令 wget http://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz tar -xvzf Python-3.6.4.tgz cd Python-3.6.4 ./configure --with-ssl make sud 阅读全文
posted @ 2018-12-27 23:39 sunnybowen 阅读(1147) 评论(0) 推荐(0) 编辑
摘要:方法二: 其实上面的程序是将字典按照传统方式拼接的,一般不用 阅读全文
posted @ 2018-12-25 23:47 sunnybowen 阅读(17752) 评论(0) 推荐(1) 编辑
摘要:import urllib.parse url = 'https://www.baidu.com/s?wd=董博文&ie=utf-8&tn=97931839_hao_pg' ''' quote url编码函数''' ret =urllib.parse.quote(url) print(ret) '''url 解码函数''' ret = urllib.parse.unquote(ret) ... 阅读全文
posted @ 2018-12-25 23:43 sunnybowen 阅读(906) 评论(0) 推荐(0) 编辑
摘要:方法2: 直接保存 运行结果: 阅读全文
posted @ 2018-12-25 23:40 sunnybowen 阅读(373) 评论(0) 推荐(0) 编辑
摘要:import urllib.request url ='http://www.baidu.com' response = urllib.request.urlopen(url=url) #print(response) # 打印对象 #print(type(response)) '''获取返回的内容,read()得到的是二进制的,要将二进制转换为str型,需要decode()方法''' # ... 阅读全文
posted @ 2018-12-24 23:32 sunnybowen 阅读(340) 评论(0) 推荐(0) 编辑
摘要:# import方式导入包时就执行包文件了,如果多次导入同一个包,也执行一次,后面的不会执行。 from rdrsTool.RdrsRequsts import RdrsRequests from rdrsTool.RdrsDB import RdrsDB from rdrsTool import 阅读全文
posted @ 2018-12-18 21:44 sunnybowen 阅读(1253) 评论(0) 推荐(0) 编辑
摘要:1 创建用户z1并且赋予所有数据库上的所有表的select权限,可以看到,user表中的select_priv是Y,而db表并没有记录。也就是说,对所有数据库都拥有相同权限的用户不需要记录db表。而仅需把user表中的select_priv改为Y即可。 2 、将z1上的权限改为只对test1数据库上 阅读全文
posted @ 2018-12-08 23:00 sunnybowen 阅读(214) 评论(0) 推荐(0) 编辑
摘要:一 存储过程与if语句 二 存储过程与case语句 三 存储过程与while 存储过程其实类似于编程语言中的函数,mysql中也有函数,区别在于函数必须有返回值,而存储过程没有。存储过程的参数有in,out,inout类型,而函数的参数只能是in类型的。如有函数需要从其他类型的数据库迁移到mysql 阅读全文
posted @ 2018-12-08 16:54 sunnybowen 阅读(309) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示