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

Hi,

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'192.168.10.1'}), 'meta': {'dhcp_server': u'192.168.10.2'}, 'dns': [], 'ips': [FixedIP({'version': 4, 'meta': {}, 'type': 'fixed', 'floating_ips': [], 'address': u'192.168.10.13'})], 'routes': [], 'cidr': u'192.168.10.0/24'})]}), 'address': u'44:44:44:58:c2:e7'})]"

Any help can be really appreciable.

Regards,
Arun V
Last edited by micseydel on Wed Dec 04, 2013 5:12 am, edited 1 time in total.
Reason: First post lock.
arunPython
 
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 irc.freenode.net!
User avatar
micseydel
 
Posts: 1132
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA


Return to General Coding Help

Who is online

Users browsing this forum: No registered users and 2 guests