📅  最后修改于: 2022-03-11 14:46:27.405000             🧑  作者: Mango
import random
def randnum(fname):
lines=open(fname).read().splitlines()
print(lines)
return random.choice(lines)
print(randnum('file1.txt'))