03 2019 档案

摘要:1、type(变量) 》输出变量的类型int、float、str or others; 2、dir() 》 dir() 函数不带参数时,返回当前范围内的变量、方法和定义的类型列表;带参数时,返回参数的属性、方法列表。如果参数包含方法__dir__(),该方法将被调用。如果参数不包含__dir__() 阅读全文
posted @ 2019-03-27 17:52 lvmenghui001 阅读(403) 评论(0) 推荐(0)
摘要:DAY = 24*60*60 today = time.strftime("%Y%m%d", time.localtime(time.time())) today_data = get_day_data(today) yestoday = time.strftime("%Y%m%d", time.localtime(time.time()-DAY)) yestoday_data = get_... 阅读全文
posted @ 2019-03-26 14:04 lvmenghui001 阅读(548) 评论(0) 推荐(0)
摘要:要求在一个有序序列中,例如[0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57, 60, 63, 66, 69, 72, 75, 78, 81, 84, 87, 90, 93, 96, 99],查找一个 阅读全文
posted @ 2019-03-20 19:12 lvmenghui001 阅读(277) 评论(0) 推荐(0)
摘要:【问题1】为什么连接的时候是三次握手,关闭的时候却是四次握手?答:因为当Server端收到Client端的SYN连接请求报文后,可以直接发送SYN+ACK报文。其中ACK报文是用来应答的,SYN报文是用来同步的。但是关闭连接时,当Server端收到FIN报文时,很可能并不会立即关闭SOCKET,所以 阅读全文
posted @ 2019-03-19 18:46 lvmenghui001 阅读(171) 评论(0) 推荐(0)
摘要:1、print函数 很琐碎,而 print 语法的变化可能是最广为人知的了,但是仍值得一提的是: Python 2 的 print 声明已经被 print() 函数取代了,这意味着我们必须包装我们想打印在小括号中的对象。Python 2 不具有额外的小括号问题。但对比一下,如果我们按照 Python 阅读全文
posted @ 2019-03-19 18:05 lvmenghui001 阅读(408) 评论(0) 推荐(0)
摘要:前后端分离: 1、get方式: items = dict(request.args.items()) app_name = items["app_name"].strip() 或 appn_ame = request.args.get("app_name") | appn_ame = request 阅读全文
posted @ 2019-03-14 09:17 lvmenghui001 阅读(640) 评论(0) 推荐(0)
摘要:官方资料:http://www.psycopg.org/psycopg/docs/ 安装: yum -y install python-psycopg2 (安装的版本可能是2.0) pip install psycopg2 (安装版本可能是2.6,目前新版,支持更多功能,建议) 如果以上2个方法安装 阅读全文
posted @ 2019-03-01 17:47 lvmenghui001 阅读(10516) 评论(0) 推荐(0)