Random strings in Python 2.6 (Is this OK?)

前端 未结 5 1713
独厮守ぢ
独厮守ぢ 2020-12-12 12:54

I\'ve been trying to find a more pythonic way of generating random string in python that can scale as well. Typically, I see something similar to

\'\'.join(r         


        
5条回答
  •  借酒劲吻你
    2020-12-12 13:24

    It seems the fromhex() method expects an even number of hex digits. Your string is 75 characters long. Be aware that something[:-1] excludes the last element! Just use something[:].

提交回复
热议问题