title: Create object of class from string user input Python
body: <p>Say I want to implement a simple database in Python. I do this by creating a class</p>
  
  <pre><code>class myStruct():
      def __init__(self,name,salary,doB,title):
          self.name=name
          self.salary=salary
          self.doB=doB
          self.title=title
  </code></pre>
  
  <p>Now, I want to create objects of that class. But I want users to input all the variables themselves for each object, and the name of the object would be the user inputted name. I saw some other StackOverflow pages describing something like this, such as this link <a href="https://stackoverflow.com/questions/3451779/how-to-dynamically-create-an-instance-of-a-class-in-python">how to dynamically create an instance of a class in python?</a>
  but that had to do with a classes imported from another module, and I didn't understand klass=global()["class_name"]. I don't understand how to link from user inputted string to use global(). </p>
  
  <p>Again, the idea is even the name of every object of class myStruct is typed in by the user, along with all the other fields for that object. How would I do this?</p>
  
  <p>EDIT: I don't think some people understood what I was trying to do. The point is not to write out </p>
  
  <pre><code>instance=MyStruct(name,salary,doB,title)
  </code></pre>
  
  <p>in my code but instead, to have a function that creates an instance that's named after whatever user inputted for name. so it would be something like </p>
  
  <pre><code>name=input('Enter your name') 
  '%s' %name=MyStruct(name) 
  </code></pre>
  
  <p>Do you get it? The name is substituted in. </p>