RE: Stripping whitespace

2008-01-24 Thread Reedick, Andrew
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of John Machin > Sent: Wednesday, January 23, 2008 5:48 PM > To: python-list@python.org > Subject: Re: Stripping whitespace > > On Jan 24, 7:57 am, "Reedick, Andr

Re: Stripping whitespace

2008-01-24 Thread cokofreedom
On Jan 24, 8:21 am, ryan k <[EMAIL PROTECTED]> wrote: > On Jan 23, 6:30 pm, John Machin <[EMAIL PROTECTED]> wrote: > > > On Jan 24, 9:50 am, ryan k <[EMAIL PROTECTED]> wrote: > > > > Steven D'Aprano, you are a prick. > > > And your reasons for coming to that stridently expressed conclusion > > afte

Re: Stripping whitespace

2008-01-23 Thread ryan k
On Jan 23, 6:30 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Jan 24, 9:50 am, ryan k <[EMAIL PROTECTED]> wrote: > > > Steven D'Aprano, you are a prick. > > And your reasons for coming to that stridently expressed conclusion > after reading a posting that was *not* addressed to you are .? Be

Re: Stripping whitespace

2008-01-23 Thread John Machin
On Jan 24, 9:50 am, ryan k <[EMAIL PROTECTED]> wrote: > Steven D'Aprano, you are a prick. And your reasons for coming to that stridently expressed conclusion after reading a posting that was *not* addressed to you are .? -- http://mail.python.org/mailman/listinfo/python-list

Re: Stripping whitespace

2008-01-23 Thread ryan k
On Jan 23, 5:37 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Wed, 23 Jan 2008 11:05:01 -0800, Paul Rubin wrote: > > ryan k <[EMAIL PROTECTED]> writes: > >> Hello. I have a string like 'LNAME > >> PASTA ZONE'. I want to create a list of those words and > >> ba

Re: Stripping whitespace

2008-01-23 Thread John Machin
On Jan 24, 9:47 am, ryan k <[EMAIL PROTECTED]> wrote: > On Jan 23, 5:37 pm, Steven D'Aprano <[EMAIL PROTECTED] > > > > cybersource.com.au> wrote: > > On Wed, 23 Jan 2008 11:05:01 -0800, Paul Rubin wrote: > > > ryan k <[EMAIL PROTECTED]> writes: > > >> Hello. I have a string like 'LNAME > > >> PASTA

Re: Stripping whitespace

2008-01-23 Thread John Machin
On Jan 24, 7:57 am, "Reedick, Andrew" <[EMAIL PROTECTED]> wrote: > > Why is it that so many Python people are regex adverse? Use the dashed > line as a regex. Convert the dashes to dots. Wrap the dots in > parentheses. Convert the whitespace chars to '\s'. Presto! Simpler, > cleaner code. Wo

Re: Stripping whitespace

2008-01-23 Thread ryan k
On Jan 23, 5:37 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Wed, 23 Jan 2008 11:05:01 -0800, Paul Rubin wrote: > > ryan k <[EMAIL PROTECTED]> writes: > >> Hello. I have a string like 'LNAME > >> PASTA ZONE'. I want to create a list of those words and > >> ba

Re: Stripping whitespace

2008-01-23 Thread Steven D'Aprano
On Wed, 23 Jan 2008 11:05:01 -0800, Paul Rubin wrote: > ryan k <[EMAIL PROTECTED]> writes: >> Hello. I have a string like 'LNAME >> PASTA ZONE'. I want to create a list of those words and >> basically replace all the whitespace between them with one space so i >> could just do lala.s

Re: Stripping whitespace

2008-01-23 Thread John Machin
On Jan 24, 7:23 am, ryan k <[EMAIL PROTECTED]> wrote: > On Jan 23, 3:02 pm, John Machin <[EMAIL PROTECTED]> wrote: > > > On Jan 24, 6:57 am, ryan k <[EMAIL PROTECTED]> wrote: > > > > So yea i will just have to count dashes. > > > Read my lips: *you* counting dashes is dumb. Writing your code so tha

RE: Stripping whitespace

2008-01-23 Thread Reedick, Andrew
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of ryan k > Sent: Wednesday, January 23, 2008 3:24 PM > To: python-list@python.org > Subject: Re: Stripping whitespace > > On Jan 23, 3:02 pm, John Machin <[EMAIL PROTE

Re: Stripping whitespace

2008-01-23 Thread ryan k
On Jan 23, 3:02 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Jan 24, 6:57 am, ryan k <[EMAIL PROTECTED]> wrote: > > > So yea i will just have to count dashes. > > Read my lips: *you* counting dashes is dumb. Writing your code so that > *code* is counting dashes each time it opens the file is sma

Re: Stripping whitespace

2008-01-23 Thread John Machin
On Jan 24, 6:57 am, ryan k <[EMAIL PROTECTED]> wrote: > So yea i will just have to count dashes. Read my lips: *you* counting dashes is dumb. Writing your code so that *code* is counting dashes each time it opens the file is smart. -- http://mail.python.org/mailman/listinfo/python-list

Re: Stripping whitespace

2008-01-23 Thread ryan k
On Jan 23, 2:53 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Jan 24, 6:17 am, ryan k <[EMAIL PROTECTED]> wrote: > > > I am taking a database class so I'm not asking for specific answers. > > Well I have this text tile: > > >http://www.cs.tufts.edu/comp/115/projects/proj0/customer.txt > > Uh-huh,

Re: Stripping whitespace

2008-01-23 Thread John Machin
On Jan 24, 6:17 am, ryan k <[EMAIL PROTECTED]> wrote: > I am taking a database class so I'm not asking for specific answers. > Well I have this text tile: > > http://www.cs.tufts.edu/comp/115/projects/proj0/customer.txt Uh-huh, "column-aligned" output. > > And this code: > [snip] > > Because the

Re: Stripping whitespace

2008-01-23 Thread John Machin
On Jan 24, 6:05 am, Paul Rubin wrote: > ryan k <[EMAIL PROTECTED]> writes: > > Hello. I have a string like 'LNAME > > PASTA ZONE'. I want to create a list of those words and > > basically replace all the whitespace between them with one space so i > > could

Re: Stripping whitespace

2008-01-23 Thread ryan k
I am taking a database class so I'm not asking for specific answers. Well I have this text tile: http://www.cs.tufts.edu/comp/115/projects/proj0/customer.txt And this code: # Table and row classes used for queries class Row(object): def __init__(self, column_list, row_vals): print l

Re: Stripping whitespace

2008-01-23 Thread ryan k
On Jan 23, 2:04 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Wed, 23 Jan 2008 10:50:02 -0800, ryan k wrote: > > Hello. I have a string like 'LNAME > > PASTA ZONE'. I want to create a list of those words and > > basically replace all the whitespace between them with one

Re: Stripping whitespace

2008-01-23 Thread John Machin
On Jan 24, 5:50 am, ryan k <[EMAIL PROTECTED]> wrote: > Hello. I have a string like 'LNAME > PASTA ZONE'. I want to create a list of those words and > basically replace all the whitespace between them with one space so i > could just do lala.split(). Thank you! > > Ryan Kaskel So whe

Re: Stripping whitespace

2008-01-23 Thread James Matthews
Using the split method is the easiest! On 23 Jan 2008 19:04:38 GMT, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Wed, 23 Jan 2008 10:50:02 -0800, ryan k wrote: > > > Hello. I have a string like 'LNAME > > PASTA ZONE'. I want to create a list of those words and > > basical

Re: Stripping whitespace

2008-01-23 Thread Paul Rubin
ryan k <[EMAIL PROTECTED]> writes: > Hello. I have a string like 'LNAME > PASTA ZONE'. I want to create a list of those words and > basically replace all the whitespace between them with one space so i > could just do lala.split(). Thank you! import re s = 'LNAME PASTAZONE'

Re: Stripping whitespace

2008-01-23 Thread Marc 'BlackJack' Rintsch
On Wed, 23 Jan 2008 10:50:02 -0800, ryan k wrote: > Hello. I have a string like 'LNAME > PASTA ZONE'. I want to create a list of those words and > basically replace all the whitespace between them with one space so i > could just do lala.split(). Thank you! You *can* just do ``lala.