[Tutor] reading from 2 file output to 1

2010-08-17 Thread nitin chandra
Hello All, I am trying to read from 2 CSV files, where first 4 ([0,1,2,3]) columns are read from 'file1' and 3 columns ([1,2,3]) from 'file2' and write them into a 3rd file 'file3', 7 columns string. The data is Numeric values both, +ve and -ve. this is how i was trying.

Re: [Tutor] reading from 2 file output to 1

2010-08-17 Thread Evert Rol
> I am trying to read from 2 CSV files, where first 4 ([0,1,2,3]) > columns are read from 'file1' and 3 columns ([1,2,3]) from 'file2' and > write them into a 3rd file 'file3', 7 columns string. The data is > Numeric values both, +ve and -ve. > > this is how i was trying. > >

Re: [Tutor] reading from 2 file output to 1

2010-08-17 Thread Alan Gauld
"nitin chandra" wrote in message news:aanlktimjrqfh=tdqtric7=utfgbxjcgaaai9coynn...@mail.gmail.com... Hello All, I am trying to read from 2 CSV files, where first 4 ([0,1,2,3]) columns are read from 'file1' and 3 columns ([1,2,3]) from 'file2' and write them into a 3rd file 'file3', 7 colum

Re: [Tutor] reading from 2 file output to 1

2010-08-17 Thread Nitin Das
I think in both the while loops , for loops are iterating over the new lines, as a result col1,col2,col3,col4,col5,col6,col7 as a result after both the while loop finishes these colums would only be having the values of the last lines from both the files. as a result the new file3 would only be hav

Re: [Tutor] reading from 2 file output to 1

2010-08-17 Thread Joel Goldstick
I haven't worked through the reading of the files, but once you have the matching lines from each you can process like this: def split_and_combine(l1, l2): first = l1.split(', ') second = l2.split(', ') combined = first[:4] + second[1:4] return combined Then write the value to the output

Re: [Tutor] box drawing characters

2010-08-17 Thread bob gailer
On 8/17/2010 12:30 AM, Bill Allen wrote: I am looking for some guidance about how to best utilize box drawing characters(using unicode?) in as portable a way as possible in Python. Any good guides out there for this? Please tell us a bit more about your goals. -- Bob Gailer 919-636-4239 Cha

Re: [Tutor] box drawing characters

2010-08-17 Thread Bill Allen
On Tue, Aug 17, 2010 at 10:00 AM, bob gailer wrote: > On 8/17/2010 12:30 AM, Bill Allen wrote: > >> I am looking for some guidance about how to best utilize box drawing >> characters(using unicode?) in as portable a way as possible in Python. Any >> good guides out there for this? >> > > Please

[Tutor] Error Using exec to Run Module Files

2010-08-17 Thread mes...@juno.com
I'm a rank beginner in Python. Took advantage of the O'Reilly one-day sale of 'Learning Python' announced on the tutor, and starting to work my way through it. When I tried out an example from pg57, on Using exec to Run Module Files, I get the following result: >>> exec(open('script1.py').read

Re: [Tutor] Error Using exec to Run Module Files

2010-08-17 Thread Knacktus
Am 18.08.2010 06:54, schrieb mes...@juno.com: I'm a rank beginner in Python. Took advantage of the O'Reilly one-day sale of 'Learning Python' announced on the tutor, and starting to work my way through it. When I tried out an example from pg57, on Using exec to Run Module Files, I get the fo