Entries from 2019-01-01 to 1 month
from pickle import dump # save with open('sample.pickle', mode='wb') as f: pickle.dump('Hello, World!', f) #load with open('sample.pickle', mode='rb') as f: pickle.load(f) Thanks to this blog (in Japanese) Python: オブジェクトを漬物 (Pickl…
Since oauth2client library seems to be deprecated, OAuth2 credentials flow should be written with google-auth library recommended. from flask import redirect, session, url_for def credentials_to_dict(credentials): return { 'token': credent…
Normally, variables can be swapped with temporary variables. tmp = a a = b b = tmp In Python, with a tuple, a, b = b, a