Python 2.7 我在Ascimatics和Python中遇到错误6
我正在学习如何将Ascimatics与Python结合使用。 当我尝试运行以下代码时:Python 2.7 我在Ascimatics和Python中遇到错误6,python-2.7,ascii,Python 2.7,Ascii,我正在学习如何将Ascimatics与Python结合使用。 当我尝试运行以下代码时: from asciimatics.screen import Screen from time import sleep def demo(screen): screen.print_at('Hello world!', 0, 0) screen.refresh() sleep(10) Screen.wrapper(demo) 我得到这个错误: Traceback (most r
from asciimatics.screen import Screen
from time import sleep
def demo(screen):
screen.print_at('Hello world!', 0, 0)
screen.refresh()
sleep(10)
Screen.wrapper(demo)
我得到这个错误:
Traceback (most recent call last):
File "C:\Users\Patrick\Pictures\Python\Westhope\2.0\test.py", line 20, in <module>
Screen.wrapper(demo)
File "C:\Python27\lib\asciimatics\screen.py", line 1336, in wrapper
unicode_aware=unicode_aware)
File "C:\Python27\lib\asciimatics\screen.py", line 1245, in open
None))
error: (6, 'CreateFile', 'The handle is invalid.')
回溯(最近一次呼叫最后一次):
文件“C:\Users\Patrick\Pictures\Python\Westhope\2.0\test.py”,第20行,在
Screen.wrapper(演示)
文件“C:\Python27\lib\asciimatics\screen.py”,第1336行,在包装器中
unicode\u感知=unicode\u感知)
文件“C:\Python27\lib\asciimatics\screen.py”,第1245行,打开
(无)
错误:(6,“CreateFile”,“句柄无效”。)
简单的回答是,您没有在正确的控制台/终端窗口中运行,您需要在标准的Windows命令提示符中运行
有关更多详细信息,请参阅