Search for a variable in a file and get its value with python
<p>I want to have some variables that are stored in a file (text file or yaml file)</p>

<p>for example if I have these variables stored in the file </p>

<pre><code>employee = ['Tom', 'Bob','Anny']
salary = 200
managers = ['Saly','Alice']
</code></pre>

<p>and I want the user to enter the list name or the variable name for example </p>

<p>if the user entered employee and want to do some operations on the list values so the user supposed to access <code>employee[0]</code>, <code>employee[1]</code> .... etc</p>

<p>how can I write a python script that will go to the file search for the correct variable and give the user access to its value</p>

<p>Thanks</p>
