How to seperate text lines from txt files in python?
You can read the file line by line, discard blank lines, and wrap the lines that are left by a list to get the same as your desired result

with open(file_name, 'r') as f:
    print([[x.strip()] for x in f.readlines() if x.strip() != ''])


By doing [x.strip()] you clear the whitespace at the beginning and end of the file and then wrap it in a list, and the condition x.strip() != '' makes sure that the line actually contains content and is not just a blank line.