首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我在使用Asciimatics和Python时出现错误6

我在使用Asciimatics和Python时出现错误6
EN

Stack Overflow用户
提问于 2018-12-28 01:19:46
回答 1查看 137关注 0票数 1

我正在学习如何在Python中使用asciimatics。当我尝试运行以下代码时:

代码语言:javascript
复制
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)

我得到了这个错误:

代码语言:javascript
复制
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.')
EN

回答 1

Stack Overflow用户

发布于 2019-06-25 03:55:37

简短的答案是,您没有在正确的控制台/终端窗口中运行,而需要在标准的Windows命令提示符下运行。

有关更多详细信息,请参阅https://asciimatics.readthedocs.io/en/latest/troubleshooting.html#i-can-t-run-it-inside-pycharm-or-other-ides

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53948645

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档