我想使用python中的子进程模块运行yamllint(yaml_file)。
我知道还有另一个模块可以在python中调用yamllint,但是我想使用子进程来实现
lint='yamllint("%s")'%(args.yaml)
print(lint)
p=subprocess.Popen(lint,shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
stdoutdata,stderr=p.communicate()
if stderr:
print(stderr)
print("Please check YAML format")
quit()
这给了我一个错误:b'/ bin / sh:-c:第0行:意外令牌"delete.yaml"\'\n/bin/sh: -c: line 0:
yamllint(“ delete.yaml”)\'\ n'
请帮助我了解其中的错误