I want the code to generate a random integer then pick out a random line from an external folder
I have tried referring it as filesongs but it gives me a textIOwrapper error
Can anyone explain why my code is saying its not finding the folder however is showing me the contents of said folder?
with open("songs.txt","r") as filesongs:
songs=filesongs.read().replace('\n', '')
random=random.randint(0,3)
ransong=open("songs.txt","r").readline(0,random)
Error Traceback:
FileNotFoundError: [Errno 2] No such file or directory: 'song one song two song three song four '