Re: Command prompt not shown when running Python script with subprocess on Windows

2014-06-04 Thread ps16thypresenceisfullnessofjoy
Thanks again for your help. I tried something similar to what you suggested: def run_app(self, app_path): args = shlex.split(app_path.replace("\\", "")) args = [arg.replace("", "\\") for arg in args] args[0] = os.path.expandvars(args[0]) try: if pywin32:

Re: Command prompt not shown when running Python script with subprocess on Windows

2014-06-01 Thread Tim Golden
29/05/2014 20:21, ps16thypresenceisfullnessof...@gmail.com wrote: That's interesting, now I learned something else too. As I said before, though, I want users to be able to enter paths in the XML file exactly the way they would be entered in a Windows shortcut. [...] Since in a Windows shortc

Re: Command prompt not shown when running Python script with subprocess on Windows

2014-05-29 Thread ps16thypresenceisfullnessofjoy
That's interesting, now I learned something else too. As I said before, though, I want users to be able to enter paths in the XML file exactly the way they would be entered in a Windows shortcut. (Actually, my program currently only has one Windows user, for whom I develop it [I don't even use i

Re: Command prompt not shown when running Python script with subprocess on Windows

2014-05-29 Thread Tim Golden
On 28/05/2014 21:46, ps16thypresenceisfullnessof...@gmail.com wrote: > > Thank you for your replies. I tried what you suggested in your second > post and it worked. > > That was actually a mistake in the app_list.xml file. As you said: > > %ProgramFiles%\LibreOffice > 4\program\swriter.exe "C:\U

Re: Command prompt not shown when running Python script with subprocess on Windows

2014-05-28 Thread ps16thypresenceisfullnessofjoy
Thank you for your replies. I tried what you suggested in your second post and it worked. That was actually a mistake in the app_list.xml file. As you said: %ProgramFiles%\LibreOffice 4\program\swriter.exe "C:\Users\Timothy\Documents\myfile.odt" should instead be: "%ProgramFiles%\LibreOffice

Re: Command prompt not shown when running Python script with subprocess on Windows

2014-05-28 Thread ps16thypresenceisfullnessofjoy
Thank you for your reply. I think I'll use PyWin32 if it's available on the user's system, and otherwise fall back to using subprocess.Popen, since I want my script to be cross-platform. os.startfile won't work for me because you can't pass arguments to the file being started. (When I first ask

Re: Command prompt not shown when running Python script with subprocess on Windows

2014-05-28 Thread Tim Golden
On 28/05/2014 06:08, Tim Golden wrote: On 28/05/2014 00:01, ps16thypresenceisfullnessof...@gmail.com wrote: I want users to be able to enter paths in the XML file exactly the way they would be entered in a Windows shortcut. Since it is possible to make a Windows shortcut for path-to-script.py w

Re: Command prompt not shown when running Python script with subprocess on Windows

2014-05-27 Thread Tim Golden
On 28/05/2014 00:01, ps16thypresenceisfullnessof...@gmail.com wrote: I want users to be able to enter paths in the XML file exactly the way they would be entered in a Windows shortcut. Since it is possible to make a Windows shortcut for path-to-script.py without the python.exe in front of it and

Re: Command prompt not shown when running Python script with subprocess on Windows

2014-05-27 Thread ps16thypresenceisfullnessofjoy
Sorry for not being explicit enough. I am aware that this would work if I called python.exe path-to-script.py with shell=False. In my Python program, I parse an XML file like the one I have included below. Then I loop through the paths of the apps listed in it and run them by calling something

Re: Command prompt not shown when running Python script with subprocess on Windows

2014-05-27 Thread Stephen Hansen
You need to call python.exe path-to-script.py, I think, not just path-to-script.py. See sys.executable (though that depends on if you're a frozen app or not). I can't be sure though because there's no code. Show code when asking questions, it helps frame the discussion and get a better answer ;)

Command prompt not shown when running Python script with subprocess on Windows

2014-05-26 Thread ps16thypresenceisfullnessofjoy
I have written a Python script with a wxPython GUI that uses subprocess.Popen to open a list of files that the user provides. One of my users would like to be able to run a Python script with my application. The Python script he is trying to run uses the command line and gets keyboard input from