title: python pass result of a mysql query as a class
body: <p>im not a python expert but came across with some weird idea that i dont know if its possible in some way.</p>
  <p>i have a table with some users like this:</p>
  <pre><code>|user | language|
  |1    |    es   |
  |2    |    en   |
  </code></pre>
  <p>i have 2 classes with several strings ie</p>
  <pre><code> class en():
      h =&quot;hello&quot;
      a =&quot;goodbye&quot;
      
      class es():
      h = &quot;hola&quot;
      a = &quot;adios&quot;
  </code></pre>
  <p>i also have a query that returns en or es for specific user</p>
  <pre><code>flang = q.idioma(uid).replace(&quot;'&quot;,&quot;&quot;)// this returns as es or en 
  </code></pre>
  <p>what i want to achieve is ... to call:</p>
  <p>flang.h but print the string dinamycally</p>
  <p>for example if user 1 gets flang.h he should see &quot;hola&quot; aswell as as with flang.a &quot;adios&quot; and same thing for user 2 but with strings in english.</p>
  <p>nevertheless even when flang gets printed as en or es it doesnt gets recognized as the class is there a way to do that? or could i store all the strings in a database and call them with some weird query as i have said im learning python by myself so i dont know if its possible</p>