我想从ascii码生成随机字。 我已经试过了:
import random
liste = [random.randint(33, 127) for i in range(8)]
osman=', '.join(str(x) for x in liste)
a=bytes.fromhex(hex(liste[0])[2:]).decode()
b=bytes.fromhex(hex(liste[1])[2:]).decode()
c=bytes.fromhex(hex(liste[2])[2:]).decode()
d=bytes.fromhex(hex(liste[3])[2:]).decode()
e=bytes.fromhex(hex(liste[4])[2:]).decode()
f=bytes.fromhex(hex(liste[5])[2:]).decode()
g=bytes.fromhex(hex(liste[6])[2:]).decode()
h=bytes.fromhex(hex(liste[7])[2:]).decode()
print(a,b,c,d,e,f,g,h,sep="")
有没有一种更简单的方法?我怎样才能发展出更多的单词?在
我发现这正是我想要的好的。谢谢给瓦西里斯G
相关问题 更多 >
编程相关推荐