Python3 诅咒 stdscr.refresh() 上的段错误

问题描述 投票:0回答:1

这是一个演示该问题的非常小的程序:

#!/usr/bin/env python3

import curses
import sys
import time

def main():
    try:
        stdscr = curses.initscr()
        stdscr.clear()
        stdscr.addstr(0,0, "This is the prompt")
        stdscr.refresh()
        time.sleep(3)
    finally:
        curses.endwin()
    return 0


if __name__ == '__main__':
    sys.exit(main())

如果我将

python3
更改为
python
,则效果完美。使用 python3,我在调用
stdscr.refresh()
时遇到分段错误。

python python-3.x macos curses macos-ventura
1个回答
0
投票

答案:似乎是 Apple 捆绑的 Python 中的一个错误。我直接访问 python.org 并下载了他们的最新版本,问题似乎已经消失了。谢谢大家的帮助。

暂时不要正式解决此问题,以防有人提出更好的答案。

© www.soinside.com 2019 - 2024. All rights reserved.