Re: [Tutor] File reading-(encoding problems)

2015-12-23 Thread Ben Finney
Ratheesh kumar writes: > Here is my code..try: > data=open('info.txt') […] Please be sure to present the code as distinct lines. You have posted it as plain text (good), the indentation is preserved (good). The problem here is that your commentary is mingled with the program code, so that

[Tutor] File reading-(encoding problems)

2015-12-23 Thread Ratheesh kumar
Here is my code..try: data=open('info.txt') for each_line in data: try: (role,line_spoken)=each_line.split(':',1) print(role,end='') print(' said: ',end='') print(line_spoken,end='') except ValueError: print(each_li