title: How do i read all the links present in a file using open function in Python?
body: <pre><code>imagelist=[]
  with open(&quot;imagelink.txt&quot;) as url:
      for url2 in url:
          if url2.strip():
              raw_data= urllib.request.urlopen(url2.strip()).read()
              im = ImageTk.PhotoImage(data=raw_data)
              result = maintext.image_create(0.0, image=im)
              imagelist.append(im) # save a reference of the image    
  </code></pre>
  <p>EDIT</p>
  <p>Ok so i copied/followed the code exactly but when i run the images are not seen the in the text widget just white screen is visible</p>