file print extra spaces

2011-03-22 Thread monkeys paw
When i open a file in python, and then print the contents line by line, the printout has an extra blank line between each printed line (shown below): f=open('authors.py') i=0 for line in f: print(line) i=i+1 if i 14: break author_list = {

Re: file print extra spaces

2011-03-22 Thread bruce bushby
Run your script and pipe the output to | od -c the octal dumper will show you what characters you're printing.I'm guessing python's print is adding one and each line in your file contains another. You can also use a , in python I forget the exact syntax, something like print(line), to

Re: file print extra spaces

2011-03-22 Thread Alex Willmer
On Mar 23, 1:33 am, monkeys paw mon...@joemoney.net wrote: When i open a file in python, and then print the contents line by line, the printout has an extra blank line between each printed line (shown below):   f=open('authors.py')   i=0   for line in f:         print(line)         i=i+1

Re: file print extra spaces

2011-03-22 Thread Thomas L. Shinnick
At 08:33 PM 3/22/2011, monkeys paw wrote: When i open a file in python, and then print the contents line by line, the printout has an extra blank line between each printed line (shown below): f=open('authors.py') i=0 for line in f: print(line) i=i+1 if i 14:

Re: file print extra spaces

2011-03-22 Thread MRAB
On 23/03/2011 01:33, monkeys paw wrote: When i open a file in python, and then print the contents line by line, the printout has an extra blank line between each printed line (shown below): f=open('authors.py') i=0 for line in f: print(line) i=i+1 if i 14: break author_list = {

Re: file print extra spaces

2011-03-22 Thread MRAB
On 23/03/2011 01:54, Thomas L. Shinnick wrote: At 08:33 PM 3/22/2011, monkeys paw wrote: When i open a file in python, and then print the contents line by line, the printout has an extra blank line between each printed line (shown below): f=open('authors.py') i=0 for line in f: print(line)