ZhangZhihui's Blog  

>>> from base64 import b64encode
>>> from os import urandom
>>> b64encode(urandom(32)).decode('utf-8')
'2owZqn8Qo0+3yqfvzvISq98/gB3OS3BWl3DJFBPsLgQ='
>>>

>>> type(os.linesep)
<class 'str'>
>>> bytes(os.linesep, 'ascii')
b'\n'

posted on 2020-05-08 14:27  ZhangZhihuiAAA  阅读(519)  评论(0编辑  收藏  举报