python基础
python基础
森林森
java学习
展开
-
Python切换数据源
# 国内源:# 清华:https://pypi.tuna.tsinghua.edu.cn/simple## 阿里云:http://mirrors.aliyun.com/pypi/simple/## 中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/## 华中理工大学:http://pypi.hustunique.com/## 山东理工大学:http://pypi.sdutlinux.org/## 豆瓣:http://pypi.douban.c原创 2020-09-04 15:49:20 · 566 阅读 · 0 评论 -
xlsxwriter+peewee写入Excel
表结构CREATE TABLE `order_info` ( `order_id` bigint(20) NOT NULL COMMENT '订单id', `order_no` varchar(50) NOT NULL COMMENT '订单编号', `check_code` varchar(10) NOT NULL DEFAULT '' COMMENT '订单取货码,店铺7天内唯一...原创 2019-12-03 17:42:28 · 412 阅读 · 0 评论 -
python-peewee读取数据
使用# !/usr/bin/python# -*-coding:utf-8-*-# @Author: 刘楠# @Time: 2019/12/3 9:05# @File : order.pyimport peeweefrom peewee import *from datetime import *from decimal import *db = MySQLDatab...原创 2019-12-03 17:41:06 · 926 阅读 · 0 评论 -
用xlrd包读取Excel文件-尽量不用xlwt包写入Excel文件最多能支持65536行数据。
1. 引有包import xlrd打开文件data = good_ivy = xlrd.open_workbook(r'商品库存.xls')获取你要打开的sheet文件# table = data.sheets()[0]# print(table.nrows)# 获取所有sheetsheet_name = data.sheet_names()[0]# 根据sheet索引或...原创 2019-12-03 17:40:13 · 2123 阅读 · 0 评论 -
python-mysql-like语句
字符串使用%需要转义goods_info_sql="SELECT goods_info_id, goods_name,goods_code,goods_barcode from goods_info where goods_name like '%%%s%%'"%("听")Python在执行sql语句的时候,同样也会有%格式化的问题,仍然需要使用%%来代替%。因此要保证在执行sql语句的时候...原创 2019-12-03 17:39:19 · 693 阅读 · 0 评论 -
python-mysql1
安装pymysqlpip install pymysqlimport pymysql# 打开数据库连接db = pymysql.connect(“localhost”,“root”,“root”,“cis_prod” )print(‘db %s’%db)# 使用 cursor() 方法创建一个游标对象 cursorcursor = db.cursor()goods_inf...原创 2019-12-03 17:38:47 · 140 阅读 · 0 评论 -
Pycharm 安装 autopep8
Pycharm 安装 autopep8打开电脑cmd,输入 pip install autopep8 回车 ok 坐等下载安装完成即可将autopep8配置到Pycharm中打开Pycharm→File→settings→Tools→Extends Tools→添加a:Name:Autopep8(可以随便取)下面的重要配置b: Tools settings下面的 Pro...原创 2019-12-03 17:35:58 · 307 阅读 · 0 评论
分享