SQLite3 でテーブル一覧取得
.tables
Ubuntu 14 Python3.4でvenv
sudo apt-get install python3.4-venv pyvenv-3.4 targetdir cd targetdir source bin/activate
sudo apt-get install python3-venvだとnot foundなので python3.4-venv
Python用vimrc
syntax enable set number set ts=4 set autoindent set expandtab set shiftwidth=4 set cursorline set showmatch let python_highlight_all = 1
PythonでJSON読み込み
import urllib2 import json req = urllib2.Request('geturl') response = urllib2.urlopen(req) r = response.read() decode_json_data = json.loads(r) getmail_list = decode_json_data['emails']
ディレクトリ下をgrep
find / -type f -print | xargs grep "hogehoge"
Pythonで実行時間を測る
import time start = time.time() #Do Something elapsed_time = time.time() - start print ("Elapsed:{0}".format(elapsed_time) + "[Sec]")