title: Load the computed LDA models and print the most common words per topic
body: <p>I'm new to python. What I'm trying to do is to read 2 parameters via console. </p>
  
  <ol>
  <li>parameter:path to a trained LDA model with gensim. </li>
  <li>parameter:the number of most common words per topic which I want to get in return.</li>
  </ol>
  
  <p>Now I want to print for all the topics the number of the most common words per topic. Now my question is how to get all the topics.</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>import sys, getopt
  import gensim
  
  def main(argv):
     input_file = argv[0] #LDA Path
     number_of_words = argv[1] #Number of most common word per topic
  
     ldamodel = gensim.models.ldamodel.LdaModel.load(input_file, mmap=None) #load model
     ldamodel.print_topic(?, number_of_words)
  
  
  
  if __name__ == "__main__":
     main(sys.argv[1:])
  </code></pre>
  
  <p><a href="https://radimrehurek.com/gensim/models/ldamodel.html" rel="nofollow noreferrer">Gensim doc</a></p>
  
  <p>Thanks</p>