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
#14
(May-02-2017, 07:47 PM)snippsat Wrote:
bigmit37 Wrote:What is taskkill, /f and /im? 
Taskkill ends one or more tasks or processes,subprocess call this.

bigmit37 Wrote:but still not quite sure what your args mean.
args is what to call in this case Taskkill.

bigmit37 Wrote:I'm assuming my arguments for the last line are incorrect?
It's not path but process name 
Open Task Manager and find the process.
It should probably be:
subprocess.run(['taskkill', '/f', '/im', "i_view64.exe"])
You can not remove os.scandir('.'),
and use a ordinary loop.
We are working with files on OS now.


Got it working with this code
'import webbrowser
import subprocess
import os, time
  
for i in Final_Bioteck[6:11]:
        webbrowser.open( '{}.png'.format(i))
        time.sleep(3)
        subprocess.run(['taskkill', '/f', '/im', "i_view64.exe"]) 
Yeah, my i_view is 64 bit, that's what was causing the malfunction of the code. 
My original loop seems to work fine though.

I'm still not quite sure what ''/f"   and '/im' stand for though.   Sad 


Thank you so much.
Reply


Messages In This Thread
RE: Closing an image opened by Pillow in Window Photo Viewer - by bigmit37 - May-02-2017, 11:39 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  image does not show with pillow Mohamad_afeff_nasser 5 1,295 Apr-13-2025, 07:53 PM
Last Post: snippsat
  tkinter photo image problem jacksfrustration 5 3,518 Jun-27-2024, 12:06 AM
Last Post: AdamHensley
  Is there a way to call and focus any popup window outside of the main window app? Valjean 6 5,533 Oct-02-2023, 04:11 PM
Last Post: deanhystad
  aoigram, pil Help with photo processing kolpac21 0 1,442 Aug-07-2023, 04:59 PM
Last Post: kolpac21
  does not save in other path than opened files before icode 3 2,894 Jun-23-2023, 07:25 PM
Last Post: snippsat
  Tkinter Pillow Resize Image Looks Choppy While Resizing AaronCatolico1 2 2,586 Jan-03-2023, 05:41 PM
Last Post: AaronCatolico1
  Pyspark Window: perform sum over a window with specific conditions Shena76 0 1,990 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 6,462 Jan-14-2022, 10:02 AM
Last Post: noahverner1995
  Closing Threads and the chrome window it spawned from Tkinter close button law 0 2,374 Jan-08-2022, 12:13 PM
Last Post: law
  Rmarkdown opened by python code - errors Rav013 0 2,680 Apr-27-2021, 03:13 PM
Last Post: Rav013

Forum Jump:

User Panel Messages

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