Help with opening up a program

This is the place for queries that don't fit in any of the other categories.

How to connect to a different program?

Postby bbesase » Wed May 08, 2013 2:02 pm

I have to create a python script that parses through folders and finds every document with a blah/blah/blah.txt file then I have to open up Microsoft Visual Studio and I have to run a program on VS that uses the .txt files. I can parse through the folders ok, I just don't know how to make it connect to VS. Any help would be great.

Oh, and this application will be ran every night at 11:00pm so I will not be here to run it, so it has to be automated.

Thanks for all the help in advance.
Posts: 18
Joined: Wed May 08, 2013 1:57 pm

Re: Help with opening up a program

Postby setrofim » Wed May 08, 2013 2:40 pm

  1. You should be able to connect to VS through COM using pywin32 library and manipulate it through the EnvDTE interface. But this will not be straight forward (I'm not aware of any guides on how to do this either, so you'll probably have to figure it out from the reference docs).
  2. You almost certainly don't want to do this. VS is used to develop and debug programs. It is not used to run them. Instead, you will build a .exe in VS and then execute that .exe on its own. You can invoke the .exe from python using the subprocess module in the standard library.
  3. To run your script periodically at a specific time, you can write it as a Windows service (again, using pywin32 library).
Posts: 288
Joined: Mon Mar 04, 2013 7:52 pm

Return to General Coding Help

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Yahoo [Bot] and 14 guests