Re: Unwanted Spaces and Iterative Loop

2014-01-27 Thread Mark Lawrence
On 27/01/2014 01:58, matt.s.maro...@gmail.com wrote: On Sunday, 26 January 2014 20:56:01 UTC-5, Chris Angelico wrote: On Mon, Jan 27, 2014 at 12:15 PM, wrote: I`m not reading and writing to the same file, I just changed the actual paths to directory. For next time, say "directory1" and

Re: Unwanted Spaces and Iterative Loop

2014-01-26 Thread matt . s . marotta
On Sunday, 26 January 2014 21:00:35 UTC-5, Jason Friedman wrote: > I`m not reading and writing to the same file, I just changed the actual paths > to directory. > > > > This is for a school assignment, and we haven`t been taught any of the stuff > you`re talking about.  Although I appreciate

Re: Unwanted Spaces and Iterative Loop

2014-01-26 Thread Jason Friedman
> > I`m not reading and writing to the same file, I just changed the actual > paths to directory. > > This is for a school assignment, and we haven`t been taught any of the > stuff you`re talking about. Although I appreciate your help, everything > needs to stay as is and I just need to create the

Re: Unwanted Spaces and Iterative Loop

2014-01-26 Thread matt . s . marotta
On Sunday, 26 January 2014 20:56:01 UTC-5, Chris Angelico wrote: > On Mon, Jan 27, 2014 at 12:15 PM, wrote: > > > I`m not reading and writing to the same file, I just changed the actual > > paths to directory. > > > > For next time, say "directory1" and "directory2" to preserve the fact >

Re: Unwanted Spaces and Iterative Loop

2014-01-26 Thread Chris Angelico
On Mon, Jan 27, 2014 at 12:15 PM, wrote: > I`m not reading and writing to the same file, I just changed the actual paths > to directory. For next time, say "directory1" and "directory2" to preserve the fact that they're different. Though if they're file names, I'd use "file1" and "file2" - call

Re: Unwanted Spaces and Iterative Loop

2014-01-26 Thread matt . s . marotta
On Sunday, 26 January 2014 19:40:26 UTC-5, Steven D'Aprano wrote: > On Sun, 26 Jan 2014 13:46:21 -0800, matt.s.marotta wrote: > > > > > I have been working on a python script that separates mailing addresses > > > into different components. > > > > > > Here is my code: > > > > > > inFile

Re: Unwanted Spaces and Iterative Loop

2014-01-26 Thread Steven D'Aprano
On Sun, 26 Jan 2014 13:46:21 -0800, matt.s.marotta wrote: > I have been working on a python script that separates mailing addresses > into different components. > > Here is my code: > > inFile = "directory" > outFile = "directory" > inHandler = open(inFile, 'r') > outHandler = open(outFile, 'w')

Re: Unwanted Spaces and Iterative Loop

2014-01-26 Thread matt . s . marotta
On Sunday, 26 January 2014 18:44:16 UTC-5, Jason Friedman wrote: > outHandler.write("FarmID\tAddress\tStreetNum\tStreetName\tSufType\tDir\tCity\tProvince\tPostalCode") > > > > ... >   > FarmID  Address > > 1       1067 Niagara Stone Rd, Niagara-On-The-Lake, ON L0S 1J0 > > 2       4260 Mountai

Re: Unwanted Spaces and Iterative Loop

2014-01-26 Thread Jason Friedman
> > > outHandler.write("FarmID\tAddress\tStreetNum\tStreetName\tSufType\tDir\tCity\tProvince\tPostalCode") > > ... > FarmID Address > 1 1067 Niagara Stone Rd, Niagara-On-The-Lake, ON L0S 1J0 > 2 4260 Mountainview Rd, Lincoln, ON L0R 1B2 > 3 25 Hunter Rd, Grimsby, ON L3M 4A3 > 4

Re: Unwanted Spaces and Iterative Loop

2014-01-26 Thread MRAB
On 2014-01-26 21:46, matt.s.maro...@gmail.com wrote: I have been working on a python script that separates mailing addresses into different components. Here is my code: inFile = "directory" outFile = "directory" inHandler = open(inFile, 'r') outHandler = open(outFile, 'w') Shouldn't you be w

Re: Unwanted Spaces and Iterative Loop

2014-01-26 Thread Mark Lawrence
On 26/01/2014 21:46, matt.s.maro...@gmail.com wrote: I have been working on a python script that separates mailing addresses into different components. Here is my code: inFile = "directory" outFile = "directory" inHandler = open(inFile, 'r') outHandler = open(outFile, 'w') outHandler.write("Fa