Curly Braces in python Popen

前端 未结 3 509
再見小時候
再見小時候 2020-12-17 03:59

Running subprocess won\'t handle curly braces correctly

# Python 2.7.4

import subprocess
subprocess.Popen(\'ls src/*.cpp\',shell=True): 
src/tonemap.cpp src         


        
3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-17 04:17

    In your case, Popen executed correctly, error is reported from ls. It should give same error when you execute the command:

    ls src/{t,p}*.cpp
    

    in terminal.

提交回复
热议问题