随笔分类 -  Python

摘要:#!/usr/bin/env python3 # -*- coding:utf-8 -*- import random, datetime def ident_generator(): #身份证号的前两位,省份代号 sheng = ('11', '12', '13', '14', '15', '21 阅读全文
posted @ 2020-12-14 17:17 yinrw 阅读(5) 评论(0) 推荐(0)
摘要:python下载python安装包 https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame 下载完后进入cmd命令行执行安装,报错: pygame-1.9.4-cp27-cp27m-win_amd64.whl is not a supported whe 阅读全文
posted @ 2019-07-03 14:38 yinrw 阅读(6962) 评论(0) 推荐(0)
摘要:python 读取excel内容,包含表格日期处理 读取内容整数变为小数,有2个解决办法: 1、在excel中数字签名加个英文单引号: ' 2、通过程序代码判断单元格内容的ctype来解决 if ctype == 2 and cell % 1 == 0.0: # ctype为2且为浮点 cell = 阅读全文
posted @ 2019-04-25 17:28 yinrw 阅读(4105) 评论(0) 推荐(0)
摘要:使用python语言连接Oracle数据库配置 阅读全文
posted @ 2019-04-24 17:54 yinrw 阅读(5517) 评论(0) 推荐(0)
摘要:GET请求实例: 阅读全文
posted @ 2019-04-23 14:48 yinrw 阅读(6013) 评论(0) 推荐(0)
摘要:匿名函数: lambda函数是一种快速定义单行的最小函数,是从Lisp借来用的,可以用在任何需要函数的地方; 例如: l=range(1,6) //1~5相加 f=lambda x,y:x+y print reduce(lambda x,y:x+y,l) 使用lambda函数应该注意的几点: lam 阅读全文
posted @ 2016-09-12 11:46 yinrw 阅读(295) 评论(0) 推荐(0)