with open("C:\code\code\Music Bot\lyrics.txt", "w+") as f:
f.write(re.sub("\[.*\]", "", f.read()))
f.close()
The code opens a txt file of song lyrics, and it should delete any section that has words inside of [], E.G. [verse]. i've tried to put these lines of code in different places in the entire code but nothing changes, ive checked with other people and the pattern stated also seems to be fine. any ideas?