Skip to content

Instantly share code, notes, and snippets.

@a-hisame
a-hisame / timeout.py
Last active September 12, 2016 16:01
タイムアウト付き標準入力モジュール
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
stdin reader with timeout implementation
タイムアウト付き標準入力モジュール
c.f. http://qiita.com/siroken3/items/4bb937fcfd4c2489d10a
'''
import sys
@a-hisame
a-hisame / response_util.py
Created December 7, 2016 13:13
Example: Utility Responses on Python bottle
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import datetime
import zipfile
import io
from bottle import HTTPResponse
@a-hisame
a-hisame / pytzjst.py
Created August 25, 2017 14:24
pytzの仕様厳格化によって時刻情報なしだとAsia/TokyoがLMT+9:19:00になる場合の対処とか
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
日本語の記事とかだと - http://qiita.com/higitune/items/0ca244373d380cf1c060
'''
import datetime
import pytz
@a-hisame
a-hisame / gzip_s3_and_json_py3.py
Created July 3, 2018 10:41
To use gzip file between python application and S3 directly for Python3
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''To use gzip file between python application and S3 directly for Python3.
Python 2 version - https://gist.github.com/a-hisame/f90815f4fae695ad3f16cb48a81ec06e
'''
import io
import gzip
import json