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命令中有双引号,随意要加转义符

原文地址:https://www.cnblogs.com/yrxns/p/12720279.html