Parsing String

This is the place for queries that don't fit in any of the other categories.

Parsing String

Postby arunPython » Wed Dec 04, 2013 4:47 am


I need the parse the following string to get the IP Address and MAC Address from this string.

str="[VIF({'ovs_interfaceid': None, 'qbg_params': None, 'meta': {}, 'qbh_params': None, 'devname': u'tapf05cfdba-99', 'type': None, 'id': u'f05cfdba-991f-41ad-a247-bb0ea74ef99f', 'network': Network({'label': u'Vlan10', 'meta': {'tenant_id': u'7b60c129780841d7838cffa6b800b304', 'injected': False}, 'bridge': None, 'id': u'91e97ca2-d2ec-42e3-830f-3e30cd374c95', 'subnets': [Subnet({'version': 4, 'gateway': IP({'version': 4, 'meta': {}, 'type': 'gateway', 'address': u''}), 'meta': {'dhcp_server': u''}, 'dns': [], 'ips': [FixedIP({'version': 4, 'meta': {}, 'type': 'fixed', 'floating_ips': [], 'address': u''})], 'routes': [], 'cidr': u''})]}), 'address': u'44:44:44:58:c2:e7'})]"

Any help can be really appreciable.

Arun V
Last edited by micseydel on Wed Dec 04, 2013 5:12 am, edited 1 time in total.
Reason: First post lock.
Posts: 1
Joined: Wed Dec 04, 2013 4:41 am

Re: Parsing String

Postby micseydel » Wed Dec 04, 2013 5:14 am

Hello, and welcome to the forum. Read this post about what you need to include in your own posts: viewtopic.php?f=10&t=145
Join the #python-forum IRC channel on for off-topic chat!

Please prefer not to PM members. The point of the forum is so that anyone can benefit. We don't want to help you over PMs/emails/Skype chats that others can't benefit from :)
User avatar
Posts: 2724
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

Return to General Coding Help

Who is online

Users browsing this forum: JChristian and 8 guests