摘要: import urllib.requestimport json,requests#发送get请求# url = 'http://api.nnzhp.cn/api/user/stu_info?stu_name=小黑马'# req = requests.get(url) #发送get请求# print 阅读全文
posted @ 2018-01-31 22:06 Flynn丶傅 阅读(150) 评论(0) 推荐(0) 编辑
摘要: import flask,jsonfrom tools123 import op_mysql #op_mysql()#import tools # tools123.op_mysql 这种方式也可以调用函数# 接口,后台服务server = flask.Flask(__name__) #把咱们这个a 阅读全文
posted @ 2018-01-26 23:15 Flynn丶傅 阅读(186) 评论(0) 推荐(0) 编辑
摘要: import redisr = redis.Redis(host='211.149.218.16',port=6379,password='123456',db=2)#连上redisprint(r.get('hahahsfdfsdf'))#r.set('nhy_session','201801211 阅读全文
posted @ 2018-01-25 21:50 Flynn丶傅 阅读(131) 评论(0) 推荐(0) 编辑
摘要: import pymysql# pyoracle# 1、连接上mysql ip 端口号 密码 账号 数据库# 2、建立游标# 3、执行sql# 4、获取结果# 5、关闭连接、关闭游标#打开仓库大门conn = pymysql.connect(host='211.149.218.16', user=' 阅读全文
posted @ 2018-01-24 23:34 Flynn丶傅 阅读(253) 评论(0) 推荐(0) 编辑
摘要: import random,string# print(random.randint(1,199))#1-199随机取一个整数# print(string.digits) #所有的数字0-9# print(string.ascii_lowercase) #所有的小写字母# print(string. 阅读全文
posted @ 2018-01-22 23:15 Flynn丶傅 阅读(148) 评论(0) 推荐(0) 编辑
摘要: import os这些必须会 print(os.getcwd())#取当前工作目录# print(os.mkdir("test1")) # 创建文件夹# print(os.remove("../day4/5.png")) # 删除文件,不能删文件夹。# print(os.listdir('c://' 阅读全文
posted @ 2018-01-20 23:10 Flynn丶傅 阅读(161) 评论(0) 推荐(0) 编辑
摘要: import json#json串就是字符串。d = { 'car':{'color':'red','price':100,'count':50}, '挨粪叉':{'color':'red','price':100,'count':50}, '挨粪叉1':{'color':'red','price' 阅读全文
posted @ 2018-01-20 22:48 Flynn丶傅 阅读(194) 评论(0) 推荐(0) 编辑
摘要: #函数即变量# len type print input str# print(all([1, 2, 3, 4])) # 判断可迭代的对象里面的值是否都为真# print(any([0, 1, 2, 3, 4])) # 判断可迭代的对象里面的值是否有一个为真# print(bin(100)) # 十 阅读全文
posted @ 2018-01-20 21:30 Flynn丶傅 阅读(136) 评论(0) 推荐(0) 编辑
摘要: #函数 方法 功能#说白了函数就是把一堆代码组合到一起,变成一个整体#提高代码复用性#函数不调用不会被执行#全局变量、局部变量# def hello (file_name,content=''):#形参,形式参数# f = open(file_name,'a+',encoding='utf-8')# 阅读全文
posted @ 2018-01-20 15:53 Flynn丶傅 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 监控日志,【集合】数据类型,对集合进行操作 监控日志脚本 阅读全文
posted @ 2018-01-11 22:42 Flynn丶傅 阅读(201) 评论(0) 推荐(0) 编辑