I want to open a text file containing a column of words and create a list or, alternatively, a string containing these words.
Why do I get this error:
>>> with open(some_file.txt, 'r') as some_file:
... some_list = [_ for _ in some_file.read().rstrip('\n')]
... print(some_list)Traceback (most recent call last):File "<stdin>", line 1, in <module>
NameError: name 'some_file' is not defined