My file is a .txt file and all comments have no spaces before them.
I have a file with 10,000 lines that looks like this and I am reading every line of the file.
## something ## something ## something 12312312 123123 12312312 123123 123123 However, my code will fail if there is not a value in every line.
Is there a way in Python to exit the program if the line is blank?
I just need a simple If statement to fix my program.
Something like
if line == blank: quit
if not line.strip():break/returnor use a try/except if it is more appropriateforloop, why not sayif not line: continueinstead of exiting the whole program?