12 2019 档案
摘要:def test(request): t = '2019-12-23 16:25:00' a = datetime.strptime(t, '%Y-%m-%d %H:%M:%S') print(a) print(type(a)) objs = Author.objects.filter(time__
阅读全文
摘要:# coding:utf-8 import requests import time import os url = "http://file.finance.sina.com.cn/211.154.219.97:9494/MRGG/CNSESH_STOCK/2018/2018-3/2018-03-
阅读全文
摘要:from concurrent.futures import ThreadPoolExecutor # 导入线程池 from threading import current_thread # 从线程中导入查看当前线程的方法 import time,random pool = ThreadPoolE
阅读全文
摘要:import requests import time url = 'http://www.google.com.hk' print(time.strftime('%Y-%m-%d %H:%M:%S')) try: html = requests.get(url, timeout=5).text p
阅读全文
摘要:authors = Author.objects.filter(name="小非").first()if authors: print(authors.__dict__) info_dic = authors.__dict__ info_dic.pop("_state") a = json.dump
阅读全文
摘要:一切情况,优先考虑pymysql,兼容性更好,特殊字符和中文不容易出现乱码。 mysqldb对中文兼容性不好,且对python3.5以后的版本不支持。
阅读全文
摘要:import pymysql con = pymysql.connect(host="127.0.0.1",user="root",passwd="root",db="test") cursor = con.cursor() sql = "insert into test2(name,gender)
阅读全文

浙公网安备 33010602011771号