os.system运行cmd命令时,命令中嵌套了引号

#coding:utf-8

import os

cmd = "pytest -v -m \"not webtest\""

os.system(cmd)

 

通过os.system执行cmd命令(pytest -v -m "not webtest"),因为cmd命令中有双引号,随意要加转义符\

posted @ 2020-04-17 15:25  悠然现南山  阅读(2028)  评论(0编辑  收藏  举报