$ ls -ld */
もしくは
$ ls -d */
""" | |
Reactive Python (RxPy) のサンプル | |
2018/04/13:まだ途中 | |
REFERENCES:: | |
https://auth0.com/blog/reactive-programming-in-python/ | |
https://github.com/ReactiveX/RxPY | |
""" | |
import threading |
""" | |
Sentry と logging の組み合わせのサンプル | |
DSN は 環境変数 SENTRY_DSN に設定してから起動します。 | |
(*) Windowsの場合、一時設定するには以下のようにします。 | |
$ set SENTRY_DSN=xxxxx | |
REFERENCES:: | |
https://docs.python.jp/3/library/logging.config.html#logging-config-dictschema | |
https://docs.sentry.io/clients/python/integrations/logging/ |
{ | |
"version": 1, | |
"disable_existing_loggers": "true", | |
"formatters": { | |
"console": { | |
"format": "[%(asctime)s][%(levelname)s] %(name)s %(filename)s:%(funcName)s:%(lineno)d | %(message)s", | |
"datefmt": "%Y/%m/%d %H:%M:%S" | |
} | |
}, | |
"handlers": { |
""" | |
起動引数で指定された fd (ファイルディスクリプタ) を使ってデータを読み取り表示します。 | |
(注意) subprocess.popen経由で呼び出されることを想定しています。 | |
""" | |
import itertools | |
import os | |
import sys | |
def go(): |
""" | |
icecream ライブラリのサンプル | |
REFERENCES:: | |
https://github.com/gruns/icecream | |
""" | |
import collections | |
import contextlib as ctx | |
import datetime |
import datetime as dt | |
import time as tm | |
import sys | |
def go(): | |
while True: | |
d = dt.datetime.now() | |
now = d.strftime('%Y/%m/%d %H:%M:%S') | |
sys.stdout.write(f'\r{now}') |