2019-04-12
阅读量:
786
编写一个Python程序来读取文件中的随机行
import random
def random_line(fname):
lines = open(fname).read().splitlines()
return random.choice(lines)
print(random_line('test.txt'))
0.0000
0
6
关注作者
收藏
评论(0)
发表评论
暂无数据
推荐帖子
2条评论
6条评论
7条评论

