I am trying to print each line from a text file into a console using IDLE with Python 2.
with open("Stats_test.txt") as f:
for line in f:
print line
When I run this file though the text from the file prints out with a space between each character. I am confused as to what I can do to fix it
Text in Text file
21/09/2014, 16:14 - Salim: How do you do it???
21/09/2014, 16:15 - Salim: <Media omitted>
21/09/2014, 16:15 - Olive: Do what!?!
21/09/2014, 16:16 - Olive: Jackie Chan!?!
21/09/2014, 16:16 - Olive: Do u know Jackie Chan can sing
21/09/2014, 16:16 - Salim: The math prob
21/09/2014, 16:16 - Salim: #funfact
21/09/2014, 16:17 - Salim: The math thing is unpossible
21/09/2014, 16:18 - Olive: Jo
21/09/2014, 16:18 - Olive: Jus like the word unpossible being in the dictionary
21/09/2014, 16:18 - Salim: Depends on where you get your dictionary from
30/09/2015, 22:27 - Salim: Like student tutors
30/09/2015, 22:27 - Salim: Duke of edinburgh
30/09/2015, 22:27 - Olive: Hahaha
30/09/2015, 22:27 - Olive: So who do u hang around with!?
30/09/2015, 22:28 - Salim: A korean
A Swedish
An American
An Austrian
30/09/2015, 22:28 - Olive:
30/09/2015, 22:28 - Olive: I guess they have names
30/09/2015, 22:28 - Olive: But thts better than jus names
30/09/2015, 22:29 - Olive: I mostly have all indians
30/09/2015, 22:29 - Salim: It's diyafah
30/09/2015, 22:29 - Salim: And indians
30/09/2015, 22:29 - Olive: Lol yeah
30/09/2015, 22:29 - Salim: Oh and the swearing
Prints out like this though in the console. Picture
I think it is due to the Unicode encoding, can someone confirm? And if so how do I remove the redundant spaces without losing the Unicode because if I use ANSI it loses some text and data.