May-19-2020, 03:48 AM
(This post was last modified: May-19-2020, 04:00 AM by gabejohnsonny21.)
I have a text file which is written like this
a
I have a text file which is written like this:
a \t b \t c \t d
d \t c \t d \t a
a \t b \t d \t a
I want to take this into a list so I wrote:
But the empty spaces become part of the list elements
How do i fix this?
a
I have a text file which is written like this:
a \t b \t c \t d
d \t c \t d \t a
a \t b \t d \t a
I want to take this into a list so I wrote:
1 2 3 |
while ( len (a_contents) > 0 ): list1.append(a_contents.strip()) a_contents = a.read(size2read) |
How do i fix this?