使用PHP输出运行python脚本。 Exec,passthru和system给出错误“找不到终端”

时间:2013-05-31 11:35:24

标签: php python terminal output

我正在尝试使用exec正常运行来自php的python脚本,但它给出了:

curses.wrapper(curses_loop) [5]
     => File "/opt/python27/lib/python2.7/curses/wrapper.py", line 22, in wrapper [6] 
     => stdscr = curses.initscr() [7] 
     => File "/opt/python27/lib/python2.7/curses/__init__.py", line 33, in initscr [8] 
     => fd=_sys.__stdout__.fileno()) [9] 
     => _curses.error: setupterm: could not find terminal

python脚本是一个在终端中工作正常的程序。这是一个货币图表,外汇和其他许多选项的程序。 我认为问题是该程序使用终端正常工作,无法在输出(stdout等)上模拟它。

此外,我尝试将wrapper.py更新为here,但失败了。错误再次发生。

我也试过,在终端export TERM=xterm-newexport TERM=xterm-256color,但又失败了。

我被困住了,请尽可能帮助,如果有可能的话。

0 个答案:

没有答案