[Tutor] 2.7.3 Popen argument issues

eryksun eryksun at gmail.com
Sun Aug 26 07:19:08 CEST 2012


On Sat, Aug 25, 2012 at 11:02 PM, eryksun <eryksun at gmail.com> wrote:
>
> out_file = "testing.avi"
> out_ip = "127.0.0.1"
> out_port = "11300"
> dst_file = '"transcode{vb=400}:std{access=file,mux=avi,dst=%s}"' % out_file
> dst_http = '"std{access=http,mux=mpjpeg,dst=%s:%s}"' % (out_ip, out_port)
> sout = "'#duplicate{dst=%s,dst=%s}'" % (dst_file, dst_http)
>
> cmd = "vlc http://%s:%s -I dummy --sout %s" % (ip, port, sout)
>
> p = subprocess.Popen(cmd.split())

Wow... That was silly of me. Don't use split(). It would split up
arguments that have internal spaces. Just build the list.

sout = "#duplicate{dst=%s,dst=%s}" % (dst_file, dst_http)

cmd = ["vlc", "http://%s:%s" % (ip, port), "-I", "dummy", "--sout", sout]
p = subprocess.Popen(cmd)


More information about the Tutor mailing list