Python3.3 で pysqlite をインストールしようとしたらうまくいかない。 検索したけど、有効な解決策が見つからなかった。
% python -V Python 3.3.3 % pip install pysqlite Downloading/unpacking pysqlite Running setup.py egg_info for package pysqlite
COLS=100000 | |
with open("/tmp/create_table_with_many_columns.hql", "w") as f: | |
f.write("CREATE TABLE many_cols_tbl (\n") | |
for i in xrange(COLS): | |
f.write("id%d INT,\n" % (i,)) | |
f.write("last_id INT);\n") |
#!/bin/bash | |
# Create Ansible directory layaout based on Ansible Documentation http://docs.ansible.com/ansible/playbooks_best_practices.html | |
# | |
# inventory file for production servers | |
touch production | |
# inventory file for staging environment | |
touch staging |
#! /usr/bin/env python3 | |
import random | |
from wsgiref import simple_server | |
誰 = ['太郎', '二郎', '花子'] | |
どこ = ['東京', '大阪', '名古屋'] | |
どうした = ['泳いだ', '走った', '仕事した'] | |
def pick(l): |
# coding=utf-8 | |
# | |
# hipchatdump2csv.py | |
# | |
# convert hipchat message logs from json to csv. | |
# csv format: | |
# from.name, from.user_id, date, message | |
# | |
# usage: python convert.py | |
# |
import re | |
# ref: Regular Expression Cookbook p.26 | |
text = """!\"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ | |
aaa | |
bbb | |
""" | |
# http://docs.python.jp/2.7/library/linecache.html | |
import linecache | |
linecache.getline("test.txt", 10) |
import csv | |
data_reader = csv.reader(open("./data.csv")) | |
for row_list in data_reader: | |
','.join(row_list) |
Python3.3 で pysqlite をインストールしようとしたらうまくいかない。 検索したけど、有効な解決策が見つからなかった。
% python -V Python 3.3.3 % pip install pysqlite Downloading/unpacking pysqlite Running setup.py egg_info for package pysqlite
# -*- coding: utf-8 -*- | |
""" | |
GF(仮) Wiki からセンバツボーナス一覧を取得し、標準出力に出力する。 | |
以下のフォーマットの csv として出力する。 | |
ガールNo, ガール名, ガールタイプ, 功セン1, 功セン2, 功セン3, 守セン1, 守セン2, 守セン3 | |
事前準備 | |
-------- |
# -*- coding: utf-8 -*- | |
# requirement: lxml | |
import requests | |
from bs4 import BeautifulSoup | |
URL = "https://gist.github.com/" | |
def get_soup(url=URL): | |
""" get soup object of url. |