I have the following code that reads in a file and stores the values into a list. It also reads each line of the file and if it sees a '(' in the file it splits it and everything that follows it on the line.
with open('filename', 'r') as f:
list1 = [line.strip().split('(')[0].split() for line in f]
Is there a way that I can change this to split not only at a '(' but also at a '#'?