我想通过os.system(command
)运行以下命令
echo '@include("acf/rows.php")' >> ../functions.php
我似乎无法正确地将引号转义。我该怎么做?
答案 0 :(得分:1)
os.system('echo \'@include(\"acf/rows.php\")\' >> ../functions.php')
非常感谢@ Tomothy32
更好:
with open("../functions.php", "a") as functions:
functions.write("@import('acf/rows.php');")
感谢@deceze