I want to run
tf changeset 12345
Using the Visual Studio 2008 command-line tool. It is located in: "c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\" , and the command that runs is the following: %comspec% /k ""c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"" x86
I would like to somehow add โtf changeset 12345โ to it and save it in the line WITHOUT first redirecting it to a file. I noticed that when I just call it from the command line, I get a graphical interface as I type:
tf changeset 12345
and I get the text output when I do:
tf changeset 12345 > out.txt
I prefer not to create the file in the file system, but hopefully just read it in the "Pythonic way".
I saw brief examples of os.system (), a subprocess, but none of them show how to do what I want to do:
- Run the process from a specific directory (preferably without using chdir)
- Executing a command containing environment variables + user text.
- Redirect output without creating a temporary file.
Hope you can help me get closer to what I want. This will help if you tested the solution on VS2008 or some other Windows program.
Thanks!
source share