title: Real Time Flask
body: <p>I am reading the data from a txt document. There is a lot of data from the TXT document. I want to parse this data. I want to send it to html in real time after splitting it into arrays. In addition, when I upload new data to the txt file while the website is online, I want it to upload this data to the arrays. The code I write is constantly showing repetitive data. Where am I making a mistake?</p>
  <pre><code>@app.route('/deneme6')
  def deneme6():
      def generate():
          enlem=[]
          boylam=[]
          with open(&quot;20210318_irkit_test_1.txt&quot;) as file:
              csv_reader = csv.DictReader(file)
  
              for i in csv_reader:
                  enlem.append(i['LATITUDE'])
                  boylam.append(i['LONGITUDE'])
              data=[enlem,boylam]
          while True:   
              for item in data:                                                                                                                                                                          
                  yield str(item)  
                      #yield data.read()
                  sleep(1)
      return app.response_class(generate(), mimetype='text/plain')
  </code></pre>