title: Close Image with subprocess
body: <p>I am trying to open an image with subprocess so it is visible to the user, then close the image so that it disapears.</p>
  
  <p>This question has been asked before, but the answers I found have not worked for me. Here is what I have checked:</p>
  
  <p><a href="https://stackoverflow.com/questions/4084322/killing-a-process-created-with-pythons-subprocess-popen">Killing a process created with Python&#39;s subprocess.Popen()</a></p>
  
  <p><a href="https://stackoverflow.com/questions/4789837/how-to-terminate-a-python-subprocess-launched-with-shell-true">How to terminate a python subprocess launched with shell=True</a></p>
  
  <p><a href="https://stackoverflow.com/questions/6725099/how-can-i-close-an-image-shown-to-the-user-with-the-python-imaging-library">How can I close an image shown to the user with the Python Imaging Library?</a></p>
  
  <p>I need the code to open an image (with Preview (optional), default on my Mac), wait a second, then close the image. </p>
  
  <pre><code>openimg = subprocess.Popen(["open", mypath])
  time.sleep(1)
  openimg.terminate()
  openimg.kill()
  </code></pre>
  
  <p>Everything is telling me to terminate() and kill(), but that still isn't closing the image.</p>
  
  <p>This does not HAVE to use preview, I am open to hearing other options as well.</p>
  
  <p>Edit: I have additionally tried the below code, still no success </p>
  
  <pre><code>print('openimg\'s pid = ',openimg.pid)
  os.kill(openimg.pid, signal.SIGKILL)
  </code></pre>