Re: [Tutor] Using split with a backslash

2008-04-02 Thread Steve Willoughby
On Wed, Apr 02, 2008 at 10:44:10AM -0400, Bryan Fodness wrote: > I have a data pair separated by a backslash. I didn' t think it would see > an end of line if the backslash was inside the quotes. > Can this be done? I don't have a choice in what the separator is. > > >>> LeafJawPositions='-42.00

Re: [Tutor] Using split with a backslash

2008-04-02 Thread Kent Johnson
Bryan Fodness wrote: > Thanks everyone, > I was trying it this way. > > x1, x2 = LeafJawPositions.split(r'\\') That is a string containing *two* backslashes. Kent ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Using split with a backslash

2008-04-02 Thread Bryan Fodness
Thanks everyone, I was trying it this way. x1, x2 = LeafJawPositions.split(r'\\') On Wed, Apr 2, 2008 at 11:00 AM, Michael Connors <[EMAIL PROTECTED]> wrote: > > >>> LeafJawPositions='-42.0001\29.8001' > > >>> LeafJawPositions > > '-42.0001\x029.8001' > > >>>

Re: [Tutor] Using split with a backslash

2008-04-02 Thread Sander Sweers
On Wed, Apr 2, 2008 at 7:44 AM, Bryan Fodness <[EMAIL PROTECTED]> wrote: > I have a data pair separated by a backslash. I didn' t think it would see > an end of line if the backslash was inside the quotes. The backlash is seen as an escape character. Try the below, notice the string prefix r and

Re: [Tutor] Using split with a backslash

2008-04-02 Thread Alan Gauld
"Bryan Fodness" <[EMAIL PROTECTED]> wrote > I have a data pair separated by a backslash. > I didn' t think it would see an end of line if the backslash > was inside the quotes. Backslashes don't indicate end of line, they indicate a continuation of a line. ie they tell Python to *ignore* the

Re: [Tutor] Using split with a backslash

2008-04-02 Thread Dave Kuhlman
On Wed, Apr 02, 2008 at 10:44:10AM -0400, Bryan Fodness wrote: > I have a data pair separated by a backslash. I didn' t think it would see > an end of line if the backslash was inside the quotes. > Can this be done? I don't have a choice in what the separator is. > > >>> LeafJawPositions='-42.00

[Tutor] Using split with a backslash

2008-04-02 Thread Bryan Fodness
I have a data pair separated by a backslash. I didn' t think it would see an end of line if the backslash was inside the quotes. Can this be done? I don't have a choice in what the separator is. >>> LeafJawPositions='-42.0001\29.8001' >>> LeafJawPositions '-42.0001\x029.8