Re: [Tutor] manipulating a string in python

2012-11-27 Thread Albert-Jan Roskam
' > >import re >media_re = re.compile(r'(auto|10+T-[HF]D)') > >instr = """tmsh list net interface 1.1 media-capa \rbilities\nnet >interface 1.1 >{\n    media-capabilities {\n        none\n        auto\n        10T-FD\n >10T-HD\n        100TX-FD\n        100TX-HD\n        1000T-FD\n >1000T-HD\n 

Re: [Tutor] manipulating a string in python

2012-11-27 Thread Dave Angel
On 11/27/2012 11:49 AM, Dave Wilder wrote: Could you please use text mode in your messages? Your email editor produces double-spacing when it converts the html stuff you wrote into the text this forum supports. > > > I believe there is a simple answer to this, but I am confused on what > direct

Re: [Tutor] manipulating a string in python

2012-11-27 Thread Stuart Sears
On 27/11/12 16:49, Dave Wilder wrote: Hello, I believe there is a simple answer to this, but I am confused on what direction I should go that would perform what I wish to do most efficiently. ** My Environment *** [root@f5ite ~/tests]$ python Python 2.7 (r27:82500, Jul 6 2010, 02:54:50) [G

[Tutor] manipulating a string in python

2012-11-27 Thread Dave Wilder
Hello, I believe there is a simple answer to this, but I am confused on what direction I should go that would perform what I wish to do most efficiently. ** My Environment *** [root@f5ite ~/tests]$ python Python 2.7 (r27:82500, Jul 6 2010, 02:54:50) [GCC 4.1.2 20080704 (Red Hat 4.1.2-48

Re: [Tutor] manipulating a string

2008-07-15 Thread Mark Tolonen
"Bryan Fodness" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] I have a string (column names) that I need to split. D_H = 'D 5 10 15 20 25 30 35 40 D Upper D Lower' I cannot do a simple list(D_H).split because the last two strings have a space between them (D Upper and D Lower a

Re: [Tutor] manipulating a string

2008-07-15 Thread Alan Gauld
"Bryan Fodness" <[EMAIL PROTECTED]> wrote I have a string (column names) that I need to split. D_H = 'D 5 10 15 20 25 30 35 40 D Upper D Lower' I assume you are reading this from a file or network and therefore don't actually know in advance what the list contains? (Otherwise just do it manu

[Tutor] manipulating a string

2008-07-14 Thread Bryan Fodness
I have a string (column names) that I need to split. D_H = 'D 5 10 15 20 25 30 35 40 D Upper D Lower' I cannot do a simple list(D_H).split because the last two strings have a space between them (D Upper and D Lower are two, not four labels). Any suggestions? _