title: How to find closest string match in a large set a variables in python?
body: <p>I need to find a way to find the most similar string to what the user has inputted within lists within individual variables variables.</p>
  
  <pre><code>L666485 = [u9027, m616, "CHELMSFORD, ", "Yes?"]
  L666461 = [u9027, m616, "CHELMSFORD, ", "Thank you."]
  L666460 = [u9029, m616, "CREALOCK, ", "The only reports of enemy activity have come from the direction of the Royal Kraal, at Ulundi."]
  L666385 = [u9027, m616, "CHELMSFORD, ", "Our runners bare his dispatches, do they not?"]
  </code></pre>
  
  <p>eg. The variable is name starts with a L followed by a number, there is then a list which contain (in left to right order) the character ID, movie ID, character name, line said.
  I need to search the line said of every L variable list item [3] </p>
  
  <p>I am creating a chat bot using python which uses the cornell movie-dialogs corpus to search through and find a line similar to a line said within the scripts, 
  the code should then find the conversation this matches and then find the next line said. 
  I have looked into <code>difflib.get_close_matches</code> but as far as I can tell this only searches a list within a singular variable. </p>
  
  <pre class="lang-py prettyprint-override"><code>#List of variables
  from movie_variables import *
  
  def main():
      #user input 
      user_input = input(":// ")
  
      #This is something that I would like it to do
      #use difflib.get_close_matches to search movie variables for something similar to user_input
      matching_line = difflib.get_close_matches(user_input, movie_variables[3]) 
  </code></pre>
  
  <p>Ideally I would like it to output the variable ID for the line that is similar eg. L6551</p>