2017年7月2日

摘要: 搜索想要的插件安装就可以了。 阅读全文
posted @ 2017-07-02 16:26 yuer011 阅读(298) 评论(0) 推荐(0) 编辑

2017年7月1日

摘要: 首先要pip install redisimport redis,jsonip='211.149.218.16'port=6379db=0passwd='123456'r = redis.Redis(host=ip,port=port,db=db,password=passwd)#链接 redisr 阅读全文
posted @ 2017-07-01 22:42 yuer011 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 首先要pip install pymysqlimport pymysql,sys#print(sys.path)from settings import mysql_info# sql='insert into user (username,password) VALUE ("haha","man" 阅读全文
posted @ 2017-07-01 22:40 yuer011 阅读(137) 评论(0) 推荐(0) 编辑

2017年6月26日

摘要: 下载Python 3.x的安装包 默认Linux的安装包只能是源码安装: >> wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.xz 由于xz结尾的文件,故可以使用如下命令来解压: >> xz -d Python-3.6.1 阅读全文
posted @ 2017-06-26 20:04 yuer011 阅读(258) 评论(0) 推荐(0) 编辑

2017年6月18日

摘要: #正则表达式就是来查找字符串的,它能查找规则比较复杂的字符串 # (.*):贪婪模式,匹配尽可能多的字符 # (.*?)或(.+?):匹配尽可能少的字符,一旦匹配到第一个就不往下走了。 import re s = 'besttest is good' print(re.match(r'be',s). 阅读全文
posted @ 2017-06-18 18:39 yuer011 阅读(156) 评论(0) 推荐(0) 编辑
摘要: import osprint(os.getcwd()) #得到当前目录#os.chmod("/usr/local",7) #给文件或者文件夹加权限,7为最高权限print(os.chdir("../")) #更改当前目录print(os.curdir) #当前目录print(os.pardir) # 阅读全文
posted @ 2017-06-18 17:16 yuer011 阅读(271) 评论(0) 推荐(0) 编辑
摘要: 模块: import模块是先从当前目录下查找引入的模块,当前目录找不到则去环境变量里面找。 查看环境变量: import sys print(sys.path) 添加环境变量:import sys sys.path.append() 例如: 添加固定文件夹下面的某个: from week5.modl 阅读全文
posted @ 2017-06-18 10:22 yuer011 阅读(121) 评论(0) 推荐(0) 编辑

2017年6月11日

摘要: ######## 内置函数print(all([1, 2, 3, 4])) # 判断可迭代的对象里面的值是否都为真print(any([0, 1, 2, 3, 4])) # 判断可迭代的对象里面的值是否有一个为真print(bin(10)) # 十进制转二进制print(bool('s')) # 把 阅读全文
posted @ 2017-06-11 17:03 yuer011 阅读(122) 评论(0) 推荐(0) 编辑
摘要: #函数的作用域是就近原则def warpper(): name = 'cici' print('i am out of box %s'%name) def deco(): name = 'lily' print('i am in box %s'%name) def hhh(): print('xxx 阅读全文
posted @ 2017-06-11 16:53 yuer011 阅读(118) 评论(0) 推荐(0) 编辑

2017年6月4日

摘要: #1\判断小数#1.92#-1.988def is_float(s): ''' 这个函数是用来判断传入的是否为小数,包括正小数和负小数三 :param s :传入一个字符串 :return: True or False ''' s = str(s) if s.isdigit(): return Fa 阅读全文
posted @ 2017-06-04 17:49 yuer011 阅读(4497) 评论(0) 推荐(0) 编辑

导航