abbarnes icon

Text File to String List

abbarnes | PRO | 09/27/18 02:02:45 PM UTC | 0 ⭐ | 238 👁️ | Never ⏰ | []
Python |

220 B

|

None

|

0 👍

/

0 👎

#Add the text file to the visual studio project
try: 
    with open('file_name.txt') as f:
        #create list with each line of text as an element
        text = f.read().splitlines()
except FileNotFoundError:
    text = None

Comments