如何格式化系统函数PHP的输出?

如何格式化系统函数PHP的输出?,php,Php,我使用函数system()运行系统进程 $buff = system('python excel.py ' . $handle->file_dst_pathname, $retval); 它以不带分隔符的行显示消息 在Python中,我使用此行打印数据: print "# %d - article \"%s\" was inserted!" % (i, article) 在系统(…)的输出之前带有echo''并后跟echo”“ $buff = "<pre>" . syst

我使用函数
system()
运行系统进程

$buff = system('python excel.py ' . $handle->file_dst_pathname, $retval);
它以不带分隔符的行显示消息

在Python中,我使用此行打印数据:

 print "# %d - article \"%s\" was inserted!" % (i, article)

系统(…)的输出之前带有
echo''并后跟
echo”“

$buff = "<pre>" . system('python excel.py ' . $handle->file_dst_pathname, $retval) . "</pre>";
或更短:

$buff=”“。系统('python excel.py.$handle->filedst_路径名,$retval)。"";
您还可以将输出的所有
“\n”
字符更改为