问题标签 [unicurses]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
280 浏览

python - 在哪里放置 PDCurses 以与 UniCurses 一起使用

我想在 Windows 上使用 UniCurses。为此,我下载了各种 ZIP 档案。我下载了pdc34dll.zip, pdc34dlls.zip,pdc34dllu.zip和. 最后一个只是来源。pdc34dllw.zippdcurses34.zip

我试图将文件放在pdc34dll-folder(从 中提取pdc34dll.zip)到 Python 3.5.2 安装文件夹的主目录、安装 Unicurses 的目录(C:\programming\python\352.lib.site-packages\unicurses)和 System32 目录(C:\windows\system32)中。

但我仍然收到pdcurses.dll无法找到的消息。

我做错了什么,我应该怎么做才能正确解决这个问题?

谢谢您的帮助。

0 投票
1 回答
871 浏览

python - UniCurses pdcurses.dll 错误

尝试导入 UniCurses 包时,我收到错误“UniCurses 初始化错误 - 未找到 pdcurses.dll”。

我已经下载了 pdcurses 发行版(特别是 pdc34dllw.zip)并将文件提取到:

  • *\Python\Lib\site-packages(unicurses.py 所在的位置)
  • *\Python\Lib\site-packages\unicurses
  • *\Python

这些都没有解决问题。

0 投票
0 回答
332 浏览

python-3.x - 致命错误:找不到 pdcurses.dll 进行链接,请确保 PDCurses v3.4+ 与 UniCurses 位于同一文件夹中

  1. 我已经在 python 中导入了 curses,但是当我尝试从 cmd 运行程序时,它说ModuleNotFoundError: no module named '_curses'
  2. 我为我的 Python 版本搜索了 Unicurses,然后安装了它,然后我对 PDcurses 做了同样的事情,并将 zip 文件的内容放在我的 python 文件夹中。
  3. 我使用 IDLE 并输入了 import unicurses 并收到错误:**致命错误:找不到 pdcurses.dll 进行链接,如果您想在 win32 上使用 UniCurses,请确保 PDCurses v3.4+ 与 UniCurses 位于同一文件夹中平台。回溯(最近一次通话最后):

事实上,我没有找到任何 pdcurses.dll,但它甚至没有放在我下载的文件中。

我像所有人一样从基本安装程序安装了 Unicurses,然后将 pdcurses 下载的内容转移到主 python 文件夹中。我在 Windows 7 上。编辑:使用 pip install windows-curses 命令安装了 pip 的诅咒,但现在尝试在 cmd 上运行时出现黑屏

0 投票
0 回答
101 浏览

python - 我可以让 UniCurses 更 Pythonic 吗?

我是一名业余程序员,自学 Python。由于 curses 模块在 Windows 上不起作用,我一直在研究 UniCurses,一个跨平台的 Curses 实现。我很失望地发现 UniCurses 函数与我喜欢的 Python 风格几乎没有相似之处,这可能是由于遗留支持和历史原因。例如,要将文本添加到终端内的“窗口”,您可以调用waddstr(WINDOW, str, [attr])mvwaddstr(WINDOW, y, x, str, [attr])。有许多这些隐秘命名的函数需要将窗口作为参数传递,并且不要将窗口视为具有方法、实例变量等的对象。

我更喜欢以 Pythonic 风格编写,其中在窗口和面板对象上调用方法,例如window_instance.add_string(string, [attr]),理想情况下为方法提供可选的 x 和 y 参数以合并mvwaddstr()到与waddstr().

想到实现这一点的方法是为窗口构造定义一个类,如下所示:

作为一个没有经验的程序员,从一种语言切换到另一种语言的心理成本有点高,用更熟悉的语法包装这些函数似乎对提高生活质量有很大好处。我是否遗漏了有关如何使用 UniCurses 的内容?以这种方式将 API 包装在更深一层的抽象层中有什么缺点和陷阱?这种方法是否有替代方法仍然允许我使用标准的面向对象的 Python 语法?

0 投票
0 回答
45 浏览

python - Reading user input using UniCurses for Python

How do I properly read user input using unicurses?

I am using wgetstr to read in user input, but how would I go about making sure that the input does not flow over to the next line. The input should just stop when the last character reaches the end of the window.

Currently:

I'm not really willing to move over to curses or ncurses since I have an almost fully fuctional (minimal) library built around unicurses.

0 投票
0 回答
32 浏览

python - 当我使用 unicurses 时,出现: NameError: name 'initscr' is not defined

我下载并安装了 unicurses,当我写入 python idle“import unicurses”时,它可以正常工作。然后我写:

然后出现名称错误:

我在互联网上到处寻找 unicurses 教程,总是解释说必须从“stdscr = initscr()”开始,并且没有暗示当“import unicurses”没有问题时它不会起作用。

例如这里:https ://medium.com/@vworri/terminal-based-ui-python-unicurses-561f94d8250c

或在这里:https ://www.youtube.com/watch?v=4s_wHUNCHK0&list=PL1H1sBF1VAKXLJ3cHisqjy4nGYDMqYIzo&index=2

我做错了什么,以至于发生了这个 NameError ?

非常感谢 问候 cs_question_asker