hex question

2010-06-25 Thread Sneaky Wombat
Why is python turning \x0a into a \n ? In [120]: h='\x0a\xa8\x19\x0b' In [121]: h Out[121]: '\n\xa8\x19\x0b' I don't want this to happen, can I prevent it? -- http://mail.python.org/mailman/listinfo/python-list

Re: loop over list and process into groups

2010-03-04 Thread Sneaky Wombat
On Mar 4, 10:55 am, mk wrote: > Sneaky Wombat wrote: > > I was going to write a def to loop through and look for certain pre- > > compiled regexs, and then put them in a new dictionary and append to a > > list, > > regexes are overkill in this case I think. > >

loop over list and process into groups

2010-03-04 Thread Sneaky Wombat
[ {'vlan_or_intf': 'VLAN2021'}, {'vlan_or_intf': 'Interface'}, {'vlan_or_intf': 'Po1'}, {'vlan_or_intf': 'Po306'}, {'vlan_or_intf': 'VLAN2022'}, {'vlan_or_intf': 'Interface'}, {'vlan_or_intf': 'Gi7/33'}, {'vlan_or_intf': 'Po1'}, {'vlan_or_intf': 'Po306'}, {'vlan_or_intf': 'VLAN2051'}, {'v

Re: using zip() and dictionaries

2009-04-30 Thread Sneaky Wombat
sh) On Apr 30, 1:09 pm, Chris Rebert wrote: > > On Apr 30, 12:45 pm, Sneaky Wombat <> wrote: > >> I'm really confused by what is happening here.  If I use zip(), I > >> can't update individual dictionary elements like I usually do.  It > >> upda

Re: using zip() and dictionaries

2009-04-30 Thread Sneaky Wombat
would happen, i'd appreciate it. My guess is that it's iterating through the the whole dictionary because of the value on the right in zip(). On Apr 30, 12:45 pm, Sneaky Wombat <> wrote: > I'm really confused by what is happening here.  If I use zip(), I > can't

Re: using zip() and dictionaries

2009-04-30 Thread Sneaky Wombat
would happen, i'd appreciate it. My guess is that it's iterating through the the whole dictionary because of the value on the right in zip(). On Apr 30, 12:45 pm, Sneaky Wombat <> wrote: > I'm really confused by what is happening here.  If I use zip(), I > can't

using zip() and dictionaries

2009-04-30 Thread Sneaky Wombat
I'm really confused by what is happening here. If I use zip(), I can't update individual dictionary elements like I usually do. It updates all of the dictionary elements. It's hard to explain, so here is some output from an interactive session: In [52]: header=['a','b','c','d'] In [53]: columnM