摘要: 数据库(右键打开位置,找到users点进去,第一个.db即文件列表,内含hd5),复制到同一目录: 阅读全文
posted @ 2019-03-13 16:50 晨光曦微 阅读(391) 评论(0) 推荐(0)
摘要: #!coding=utf-8 import requests import re import time import json from requests.packages.urllib3.exceptions import InsecureRequestWarning import pandas as pd requests.packages.urllib3.disable_warnings... 阅读全文
posted @ 2019-03-13 16:44 晨光曦微 阅读(439) 评论(0) 推荐(0)
摘要: import pymysql db = pymysql.connect(host='localhost', user='root', password='pz2212', port=3306, db='spiders') cursor = db.cursor() data = { 'id': '20120001', 'name': 'Bob', 'age': 20 } t... 阅读全文
posted @ 2019-03-13 16:42 晨光曦微 阅读(229) 评论(0) 推荐(0)
摘要: import mitmproxy.http from mitmproxy import ctx, http class Joker: def request(self, flow: mitmproxy.http.HTTPFlow): if flow.request.host != "www.baidu.com" or not flow.request.path.sta... 阅读全文
posted @ 2019-03-13 16:41 晨光曦微 阅读(490) 评论(0) 推荐(0)
摘要: from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support import expected_conditions as ec from seleni... 阅读全文
posted @ 2019-03-13 16:39 晨光曦微 阅读(495) 评论(0) 推荐(0)
摘要: #!python3 #updateProduce.py-更正指定产品 成本价格(第二列) import openpyxl wb=openpyxl.load_workbook('produceSales.xlsx') sheet=wb.active #或sheet=wb['Sheet'] # 需要更新成本价格的产品,字典格式 PRICE_UPDATES = {'Garlic': 3.07, ... 阅读全文
posted @ 2019-03-13 16:33 晨光曦微 阅读(298) 评论(0) 推荐(0)
摘要: import requests from pyquery import PyQuery as pq url='https://www.zhihu.com/explore' headers={ 'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Geck... 阅读全文
posted @ 2019-03-13 16:30 晨光曦微 阅读(340) 评论(0) 推荐(0)
摘要: grid = [['.', '.', '.', '.', '.', '.'], ['.', 'O', 'O', '.', '.', '.'], ['O', 'O', 'O', 'O', '.', '.'], ['O', 'O', 'O', 'O', 阅读全文
posted @ 2019-03-13 16:28 晨光曦微 阅读(105) 评论(0) 推荐(0)
摘要: name = ''#名字为空即代表False while not name:#not name=False即 真,将执行循环体 print('Enter your name:') name = input()#给name赋值,如输入了空以外值,不会再有下一个循环while print('How many guests will you have?') numOfG... 阅读全文
posted @ 2019-03-13 16:27 晨光曦微 阅读(329) 评论(0) 推荐(0)
摘要: #让用户输入一个宠物名字,然后检查该名字是否在宠物列表中 myPets = ['Zophie', 'Pooka', 'Fat-tail'] print('Enter a pet name:') name = input() if name not in myPets: print('I do not have a pet named ' + name) else: print(n... 阅读全文
posted @ 2019-03-13 16:25 晨光曦微 阅读(229) 评论(0) 推荐(0)