Calling subprocess with arguments
mk.fraggod at gmail.com
Fri Jun 19 17:13:55 CEST 2009
On Fri, 19 Jun 2009 07:55:19 -0700
Tyler Laing <trinioler at gmail.com> wrote:
> I want to execute this command string: vlc -I rc
> This allows vlc to be controlled via a remote interface instead of the
> normal gui interface.
> Now, say, I try this from subprocess:
> >>>p=subprocess.Popen('vlc -I rc test.avi'.split(' '), shell=False,
> stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
> But I don't get the remote interface. I get the normal gui interface. So
> how do I do it? I've tried passing ['vlc', '-I', 'rc'], I've tried ['-I',
> 'rc'] with executable set to 'vlc'. I've had shell=True, I've had
> shell=False. I've tried all these combinations.
> What am I doing wrong?
Write a simple script:
And replace 'vlc' with a path to this script, then invoke it from a
shell, compare the results.
If it gets the right stuff, try the same with os.environ (prehaps vlc
keeps socket location there, just like ssh/gpg-agents?).
Mike Kazantsev // fraggod.net
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 205 bytes
Desc: not available
More information about the Python-list