0

Is it possible to use Python to open a file from an existing running application? For example, I have a notepad application open. If I run os.startfile(newnotepad.txt) it opened up a new notepad application. I would like it to open in the existing one.

1 Answer 1

2

That is completely dependent on the application in question. Some applications do support a mechanism for specifying a document to open via COM or DDE, some may allow you to invoke a second copy with the file as an argument which will tell the first to open that file, and some may have no provision for this at all. You will need to check the documentation of the application in question to see which, if any, it supports.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.