诅咒文本板:“ _ curses.error:setupterm:找不到终端”

问题描述

我正在使用curses.textpad模块在​​MacBook上制作Python程序。这是我完整的代码

import curses
from curses.textpad import TextBox,rectangle

def editor(stdscr):
    stdscr.addstr(0,"Type something: (hit Ctrl-G to exit)")

    editor = curses.newwin(5,30,2,1)
    rectangle(stdscr,1,1 + 5 + 1,1 + 30 + 1)
    stdscr.refresh()

    Box = TextBox(editor)
    Box.edit()

    message = Box.gather()
    print(message)

text = curses.wrapper(editor)
print("Here's what you typed:")
print(text)

每当我尝试运行该错误时,都会不断出现此错误

Traceback (most recent call last):
  File "/Users/Donoru/Desktop/editor/main.py",line 17,in <module>
    text = curses.wrapper(editor)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/curses/__init__.py",line 84,in wrapper
    stdscr = initscr()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/curses/__init__.py",line 29,in initscr
    setupterm(term=_os.environ.get("TERM","unkNown"),_curses.error: setupterm: Could not find terminal

我该如何解决

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)