Python Forum
Closing an image opened by Pillow in Window Photo Viewer
Thread Rating:
  • 2 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Closing an image opened by Pillow in Window Photo Viewer
#1
I'm trying to close each image opened via iteration, within each iteration.




for i in Final_Bioteck[:5]:
     with Image.open('{}_screenshot.png'.format(i)) as test_image:
        test_image.show()
        time.sleep(2)
 My code doesn't seem to close the photos opened via Windows Photo Viewer. 
I also tried,



test_image.close()

 , but no result.





My loop above is opening 5 Windows Photos Viewer dialogs; I was hoping that as I loop through each iteration, each window would be closed.


Thank you.
Reply


Messages In This Thread
Closing an image opened by Pillow in Window Photo Viewer - by bigmit37 - May-01-2017, 03:49 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Is there a way to call and focus any popup window outside of the main window app? Valjean 6 1,860 Oct-02-2023, 04:11 PM
Last Post: deanhystad
  aoigram, pil Help with photo processing kolpac21 0 595 Aug-07-2023, 04:59 PM
Last Post: kolpac21
  does not save in other path than opened files before icode 3 945 Jun-23-2023, 07:25 PM
Last Post: snippsat
  Tkinter Pillow Resize Image Looks Choppy While Resizing AaronCatolico1 2 1,422 Jan-03-2023, 05:41 PM
Last Post: AaronCatolico1
  Pyspark Window: perform sum over a window with specific conditions Shena76 0 1,199 Jun-13-2022, 08:59 AM
Last Post: Shena76
Question How to get html information from a tab of my default browser opened with webbrowser? noahverner1995 2 4,556 Jan-14-2022, 10:02 AM
Last Post: noahverner1995
  Closing Threads and the chrome window it spawned from Tkinter close button law 0 1,740 Jan-08-2022, 12:13 PM
Last Post: law
  Rmarkdown opened by python code - errors Rav013 0 2,111 Apr-27-2021, 03:13 PM
Last Post: Rav013
  Invert Pillow image colours chesschaser 5 3,911 Jul-11-2020, 02:59 PM
Last Post: chesschaser
  Add Photo in Python adninqasifa 4 6,053 Nov-26-2018, 06:06 PM
Last Post: adninqasifa

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020