Python创建一个Popen shell命令列表

时间:2015-12-03 14:43:47

标签: python shell subprocess popen

请有人帮我创建一个Popen命令行列表...

  

识别-format%b:%w:%h:%r:%#myimage.jpg

我有......

    var that = this;
    that.onPlayerReady = function(API) {
        that.API = API;
    };

            if (window.matchMedia("(orientation: landscape)").matches) {
            // you're in LANDSCAPE mode
            console.log("Landscape") //works fine
            that.API.play(); //works also very fine
            that.API.toggleFullScreen(); //no chance....
        }

但这不起作用。原始命令行在命令行中正常工作。但是这样就无法让它以python的形式运行。

1 个答案:

答案 0 :(得分:1)

试试这个:

cmd=Popen(['identify', '-format', '%b:%w:%h:%r:%#', 'myimage.jpg'])

你必须将args分解为单独的参数列表