Re: [Tutor] critique my script: add columns in a file

2007-02-14 Thread Kent Johnson
Christopher Spears wrote: > I created a file called table.txt. Here is the file's > contents: > > 1 5 10 2 1.0 > 2 10 20 4 2.0 3 > 3 15 30 8 3 2 1 > 4 20 40 16 4.0 > > I modified a script I fo

Re: [Tutor] critique my script: add columns in a file

2007-02-14 Thread Alan Gauld
"Christopher Spears" <[EMAIL PROTECTED]> wrote > I modified a script I found in "Programming Python" I assume it was the first edition of Programming Python? > #!/usr/bin/python > import string > > def find_longest_line(fileName): > longest_col = [] > for lines_in_file in open(fileName, 'r').rea

[Tutor] critique my script: add columns in a file

2007-02-13 Thread Christopher Spears
I created a file called table.txt. Here is the file's contents: 1 5 10 2 1.0 2 10 20 4 2.0 3 3 15 30 8 3 2 1 4 20 40 16 4.0 I modified a script I found in "Programming Python" and created scri