python 乱序

from random import shuffle, choice
file  = open("username","r")
content = []
for read in file.readlines():
    read = read.strip().lstrip()
    content.append(read)

shuffle(content)

print choice(content))

你可能感兴趣的:(python)