tips

PythonでGUIDを生成する

PythonでGUIDを生成する方法。 標準ライブラリのuuidモジュールを使えば良い。 >>> import uuid >>> str(uuid.uuid4()) '4155f6f5-fa9e-4669-87a1-7ee43a4a70c5'

htmlentitydefs

こんなモジュールがあるのか。 >>> import htmlentitydefs >>> htmlentitydefs.name2codepoint['copy'] 169 >>> htmlentitydefs.codepoint2name[ord('&')] 'amp'