title: How to display TQDM from terminal into GUI progress bar?
body: <p>Hello I am new to python and I am setting up a progress bar for a college project. Currently I have the progress bar running on background in the terminal with tqdm while the loop is running and returns the results in the main GUI body after loop is complete. I am trying to display the progress from the terminal into the main GUI body as progress bar. Any help would be greatly appreciated.</p>
  <p>Here is part of the code:</p>
  <pre><code>    keywordlist = open('IP.txt', 'r')
      loglines = [n for n in logfile]
      keywords = [n for n in keywordlist]
      for line in tqdm.tqdm(loglines):
          progress.update()
          progress['value'] = 100
          time.sleep(0.01)
          for word in keywords:
              if word.strip() in line.strip():
                  processes.append(line)
                  with open(&quot;DNSResults.txt&quot;, &quot;w&quot;) as txt_file:
                      for line in processes:
                          txt_file.write(&quot;&quot;.join(line)+&quot;\n&quot;)
      logfile = open('DNSResults.txt', 'r')
      keywordlist = open('EmotetIP.txt', 'r')
      loglines = [n for n in logfile]
      keywords = [n for n in keywordlist]
      
      for line in loglines:
          for word in keywords:
              if word.strip() in line.strip():    
                  msg3 =&quot;Matches found with the following Ip Adresses: &quot; + str(word) +&quot;\n&quot;
                  txt.insert(0.0,msg3)```
  </code></pre>
  <p>And than I have tkinter progress bar used for the GUI.</p>
  <pre><code>progress = ttk.Progressbar(root, orient = HORIZONTAL, length = 100, mode = 'determinate')
  progress.pack(side=BOTTOM, fill=X)
  </code></pre>