import random lines = open('./database.txt','r').readlines() print(lines[random.randrange(0, len(lines))])
Standard input is empty
Standard output is empty
Traceback (most recent call last): File "./prog.py", line 2, in <module> FileNotFoundError: [Errno 2] No such file or directory: './database.txt'