Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x python:诅咒在空闲时冻结_Python 3.x_Ide_Curses - Fatal编程技术网

Python 3.x python:诅咒在空闲时冻结

Python 3.x python:诅咒在空闲时冻结,python-3.x,ide,curses,Python 3.x,Ide,Curses,我试图了解curses。我导入了curses模块并开始在IDE中工作。在将curses.initscr设置为变量stdscr后,空闲突然冻结。我就是这样做的: >>> import curses >>> stdscr = curses.initscr() 然后IDE就冻结了。有人能解释一下刚才发生了什么吗?我怎样才能避免这种情况发生呢?curses模块只在Unix上运行,使用固定间距字体、行和列、文本终端或模拟文本终端的图形窗口。Idle在无终端进程中执行用

我试图了解curses。我导入了
curses
模块并开始在IDE中工作。在将
curses.initscr
设置为变量stdscr后,空闲突然冻结。我就是这样做的:

>>> import curses
>>> stdscr = curses.initscr()

然后IDE就冻结了。有人能解释一下刚才发生了什么吗?我怎样才能避免这种情况发生呢?

curses模块只在Unix上运行,使用固定间距字体、行和列、文本终端或模拟文本终端的图形窗口。Idle在无终端进程中执行用户代码,并在其tk图形窗口外壳中显示结果。这两者不兼容,我怀疑任何图形IDE都是如此,除非IDE注意到“导入诅咒”并以特殊模式运行程序

我的建议是在Idle或任何其他编辑器中编辑代码,然后在文本模式控制台窗口的命令行中运行代码。比如说

.../mydir> python try_curses.py
其中mydir是包含文件的目录