ken_all csv
- http://www.post.japanpost.jp/zipcode/download.html
- http://www.post.japanpost.jp/zipcode/dl/roman-zip.html
Pythonバージョン 3.4
| """ | |
| socketモジュールを使ってHello, World | |
| """ | |
| import socket | |
| bind_address = '127.0.0.1' | |
| bind_port = 7777 | |
| def main(): |
| import datetime | |
| def decorator(limit_time): | |
| def factory(func): | |
| def wrapped(*args, **kwargs): | |
| now = datetime.datetime.now() | |
| if limit_time < now: | |
| raise Exception( | |
| "{} を過ぎているので実行できません。now={}".format( |
| import os | |
| import threading | |
| from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor | |
| from time import sleep | |
| def writer(value): | |
| sleep(1) | |
| print("PID={}, ThreadID={}: {}".format(os.getpid(), threading.get_ident(), value)) | |
| from bpmappers import * | |
| class ObjectMapper(Mapper): | |
| key = RawField() | |
| class ObjectListMapper(Mapper): | |
| member = NonKeyListDelegateField(ObjectMapper) | |
| def filter_member(self): | |
| return self.data |
| # coding: utf-8 | |
| def _sort_key(record): | |
| """ | |
| 金額部分を数値型に変換して返す | |
| 30円 -> 30 | |
| """ | |
| price = int(record[2][:-1]) | |
| return price |
ken_all csv
Pythonバージョン 3.4
| # coding: utf-8 | |
| def hello(ui, repo, **ops): | |
| print u"こんにちは" | |
| cmdtable = { | |
| "^hello": [hello, []], | |
| } |
| colorscheme django | |
| "set guifont=MS_ゴシック:h10 | |
| set guifont=VL_ゴシック:h10 | |
| set lines=40 | |
| set columns=140 | |
| set guioptions-=T | |
| set guioptions-=m |
| try: | |
| import sys, pdb, traceback | |
| spam() | |
| except: | |
| type, value, tb = sys.exc_info() | |
| traceback.print_exc() | |
| pdb.post_mortem(tb) |