Close pdf-file or exe-application from Python
===

 1. My application is opening a pdf-file with os.startfile on user's request (push button). Is there any way to close this pdf when user pushes the button another time? If this is not done, I get the error:

    WindowsError: [Error 32] The process cannot access the file because it is being used by another process: 'default_report.pdf'

 2. Another related question. My application is compiled as an executable and is called from another, VB6, application (also on push button). Is there any way to detect that executable is already running (exe-file always has the same location) from Python and kill it in this case prior to starting it again? Problem is similar, I get the error if I run the executable second time because they start to conflict (they use common db). From VB6 it doesn't work somehow, I don't know details...

p.s. I use Python 3.2, PyQt 4 and cx_freeze for exe production if it matters.