原创 退出vim常用方法

退出vim常用方法: 退出vim 方法 只讀退出 按esc,輸入冒號,輸入q,回車 不保存退出 按esc,輸入冒號,輸入q!,回車 保存退出 按esc,輸入冒號,輸入x,回車 保存退出 最快捷的方法:

原创 Mac 安裝Qt

1.安裝Qt brew install qt 2.配置Qt環境變量 echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.bash_profile source ~/.bas

原创 PyQt5 runJavaScript的使用

PyQt5 runJavaScript的使用 示例代碼: from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QPushButton from PyQt5

原创 brew link sip出錯

brew安裝sip時出現的問題: $ brew install sip Error: The `brew link` step did not complete successfully The formula built, bu

原创 Mac 安裝PyQt5

PyQt5官方安裝教程指出2種安裝方法: Installing from Wheels Building and Installing from Source 網上搜羅的大多是按照第二種方法安裝的,本文采用第一種方法更爲簡便省

原创 “'WebElement' object is not iterable”

問題代碼: # -*- coding: UTF-8 -*- from selenium import webdriver def main(): url = 'http://example.webscraping.co

原创 PyQt5 渲染動態網頁

PyQt5 渲染動態網頁 示例代碼: # -*- coding: UTF-8 -*- import sys from PyQt5.QtCore import QUrl from PyQt5.QtWidgets import QAp

原创 brew link python3出錯

brew安裝Python3時出現的問題: $ brew install python3 Warning: python3 3.6.3 is already installed, it's just not linked. You

原创 brew info python

使用brew安裝python前執行如下命令,可以獲取很多信息: brew info python 附圖: 備註: 因比較習慣用python虛擬環境,故沒有配置環境變量; 相應的pip安裝的包的路徑也在虛擬環境路徑中。 br

原创 Mac “'chromedriver' executable needs to be in PATH”

安裝selenium pip install selenium Mac 下使用selenium打開一個空的瀏覽器窗口: from selenium import webdriver driver = webdriver.Chrom

原创 Mac 創建指定版本的python虛擬環境

目前條件: python版本 安裝情況 2.7.10 系統自帶 2.7.14 brew安裝 3.6.3 brew安裝 創建虛擬環境 python版本 創建虛擬環境命令 2.7.10 $ virt

原创 python sqlite 獲取表名、表的列名

# -*- coding: UTF-8 -*- import sqlite3 import pprint def sqlite_read(): """python讀取sqlite數據庫文件 """ myd

原创 Mac “'geckodriver' executable needs to be in PATH”

Mac 下使用selenium打開一個空的瀏覽器窗口: from selenium import webdriver driver = webdriver.Firefox() python報錯: 'geckodriver' exe

原创 python re正則表達式

例:提取=與,或=與}之間的數字: re.findall('=(\d+)(?:,|})', str) 參考: https://www.cnblogs.com/dreamer-fish/p/5282679.html https

原创 Fidder安裝及使用

一、在linux下安裝抓包工具fiddler 1、安裝mono環境 sudo apt-get install mono-complete 2、下載並解壓 地址:http://fiddler.wikidot.com/mono 3、啓動