popen[2-4] does not work with parameters inside quotes

A

Anders Dalvander

os.popen[2-4] does not work with parameters inside quotes, nor do
os.popen. At least on Windows.

import os
cmd = '"c:\\command.exe" "parameter inside quotes"'
os.popen4(cmd)

Results in the following error message:

'c:\\command.exe" "parameter inside quotes' is not recognized as an
internal or external command,
operable program or batch file.

// Dalle
 
E

Emile van Sebille

"Anders Dalvander"
os.popen[2-4] does not work with parameters inside quotes, nor do
os.popen. At least on Windows.

import os
cmd = '"c:\\command.exe" "parameter inside quotes"'
os.popen4(cmd)

Results in the following error message:

Hmm... not for me... I get:
(<open file '"c:\command.exe" "parameter inside quotes"', mode 'w' at
0x008E6620>, <open file '"c:\command.exe" "parameter insid
e quotes"', mode 'r' at 0x008EC060>)


Emile van Sebille
(e-mail address removed)
 
D

Derrick 'dman' Hudson

Anders Dalvander said:
cmd = '"c:\\command.exe" "parameter inside quotes"'
os.popen4(cmd)
'c:\\command.exe" "parameter inside quotes' is not recognized as an
internal or external command, operable program or batch file.

Not surprising. Pick command.COM or cmd.exe.

-D
 
A

Anders Dalvander

Emile van Sebille said:
Hmm... not for me... I get:

(<open file '"c:\command.exe" "parameter inside quotes"', mode 'w' at
0x008E6620>, <open file '"c:\command.exe" "parameter insid
e quotes"', mode 'r' at 0x008EC060>)

Did you try with having the exe-file in another directory with spaces:
"c:\path with spaces\command.exe"?

What Windows version are you running?

// Dalle
 
E

Emile van Sebille

Anders Dalvander said:
"Emile van Sebille" <[email protected]> wrote in message

Did you try with having the exe-file in another directory with spaces:
"c:\path with spaces\command.exe"?

This wraps, but here's the result:

Python 2.4a0 (#46, Oct 25 2003, 09:39:59) [MSC v.1200 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.Studio\\Common\\Tools\\dfview.ex
e" "parameter inside quotes"'(<open file '"C:\Program Files\Microsoft Visual
Studio\Common\Tools\dfview.exe"
"parameter inside quotes"', mode 'w' at 0x008E4EE0>, <open file '"C:\Program
Fil
es\Microsoft Visual Studio\Common\Tools\dfview.exe" "parameter inside
quotes"',
mode 'r' at 0x008EC660>)
What Windows version are you running?
This was on winxppro.

Emile
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top