随笔分类 -  python

python3查询数据库并生成excel报表
摘要:#!/usr/bin/env python3 #encoding=UTF-8 import os import time import xlwt hostIp = 'xxx.xxx.xxx.xx' user = 'user0001' passwd = 'xxxx' db = 'db01' sqlStr1 = 'SELECT timeout_day as 逾期天数,COUNT(1) as 统... 阅读全文

posted @ 2017-05-31 17:03 vijayfly 阅读(6688) 评论(1) 推荐(0)

python3连接mysql
摘要:#!/usr/bin/python3 import pymysql conn = pymysql.connect(host='10.60.10.11',port=3306,user='root',passwd='xxxxx',db='haoxx') cur = conn.cursor() cur.execute("select car_id,car_name from car where... 阅读全文

posted @ 2017-05-27 18:30 vijayfly 阅读(246) 评论(0) 推荐(0)

centos6.8 搭建nginx+uwsgi+Flask
摘要:1.安装 yum install nginx -y pip3 install uwsgipip3 install Flask 2.uwsgi配置(保存/etc/uwsgi.ini,run:uwsgi /etc/uwsgi.ini) 3.nginx配置 4.安装 Supervisor yum inst 阅读全文

posted @ 2017-01-16 18:57 vijayfly 阅读(1611) 评论(0) 推荐(0)

CentOS6.5(Python-2.7.12)安装Pip
摘要:1.安装setuptools(下载链接可从https://pypi.python.org/pypi/setuptools#code-of-conduct寻找) 2.安装pip 阅读全文

posted @ 2016-11-30 12:56 vijayfly 阅读(612) 评论(0) 推荐(0)

PYTHON3 urllib2库
摘要:python 3.x中urllib库和urilib2库合并成了urllib库。。其中urllib2.urlopen()变成了urllib.request.urlopen() urllib2.Request()变成了urllib.request.Request() 阅读全文

posted @ 2016-11-10 16:29 vijayfly 阅读(320) 评论(0) 推荐(0)

python3安装builtwith
摘要:因为Python2中的Exception,e 的写法不再支持,需要修改成Exception as e. (这句话看了我半天, 明明说是抛出了Exception e, 却硬是没看到e的信息,火大!) 另外Python2中的print语句在Python3中需要写成print(),按照错误提示修改对应行数 阅读全文

posted @ 2016-11-10 15:27 vijayfly 阅读(2453) 评论(2) 推荐(0)

pythonMD5加密
摘要:#MD5加密def md5_key(arg): hash = hashlib.md5() hash.update(arg) return hash.hexdigest() 阅读全文

posted @ 2016-02-22 16:50 vijayfly 阅读(3605) 评论(0) 推荐(0)

python随机验证码函数
摘要:#验证码函数def yzm(i): code = [] for i in range(i): if i == random.randint(1,3): code.append(str(random.randint(1,9))) else: tmp = random.randint(65,90) co 阅读全文

posted @ 2016-02-22 16:33 vijayfly 阅读(251) 评论(0) 推荐(0)

导航