![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
Tuu_Zed
这个作者很懒,什么都没留下…
展开
-
Python计算日期差
import datetime #设置一个时间 d1 = datetime.datetime(2012, 10, 7) #取得当前时间 d2 = datetime.datetime.now() print((d2 - d1).days)原创 2015-10-17 17:27:24 · 1206 阅读 · 0 评论 -
Python3 pymysql连接MySQL数据库
#!/usr/bin/python # -*- coding:utf8 -*-import pymysql#取得数据库连接对象 conn = pymysql.connect(host='127.0.0.1',port=3306,user='root',passwd='1234',db='python') #取得游标对象 cur = conn.cursor()#插入数据 cur.execute("IN原创 2015-08-13 13:11:58 · 1439 阅读 · 0 评论