Python: Transform a string into a variable and its value
<p>I am relatively new on Python. </p>

<p>The program I am writing reads line by line a XML file using a while loop. The data read is split so the information that I get is something like:</p>

<p>datas = ['Name="Date"', 'Tag="0x03442333"', 'Level="Acquisition"', 'Type="String"']</p>

<p>-Inside my program, I want to assign to some variables called exactly as the word before the = sign, the information after the = sign in the previous strings. And then I will introduce them as attributes for a class (this already works)
- What I have done until the moment is: </p>

<pre><code>Name = ''
Tag = ''
Level = ''
Type = ''

for i in datas:
    exec(i)
</code></pre>

<p>-It works fine that way. However, I do not want to use the exec function. Is there any other way of doing that?</p>

<p>Thank you</p>