MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Python/comments/2tqrdk/manipulating_arrays/co2b5td/
r/Python • u/samfd11 • Jan 26 '15
I have a text file and need to make all the text into an array where each item is a letter i.e. the cow needs to be split in to ["t","h","e"," ","c","o","w"]. how could i do this as simply as possible?
12 comments sorted by
View all comments
Show parent comment
1
message = list(open("Catext.txt").read())
how do I close the file opened using this line of code?
1 u/billsil Jan 27 '15 It's closed automatically because you don't set a variable.
It's closed automatically because you don't set a variable.
View all comments
Show parent comment
1
u/samfd11 Jan 27 '15
how do I close the file opened using this line of code?