Python和(n)诅咒 [英] Python and (n)curses

查看:92
本文介绍了Python和(n)诅咒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要开发一个跨平台的文本模式应用程序。我想用
来用Python做这件事,我想用一个成熟的文本模式库

用于UI的东西。


我认为,显而易见的选择是ncurses。但据我所知,

它在Windows上不适用于Python?


有解决方法吗?或者是否有替代库可能会使用
代替(n)诅咒?我知道我可以在Windows上使用* n诅咒和

控制台等等,但这当然不是最理想的。


/ David

I need to develop a cross-platform text-mode application. I would like
to do it in Python and I would like to use a mature text-mode library
for the UI stuff.

The obvious choice, I thought, was ncurses. But as far as I can tell,
it is not available for Python on Windows?

Is there a workaround? Or are there alternative libraries that might
be used instead of (n)curses? I know I can use (n)curses on *nix and
console on Windows etc., but that is of course suboptimal.

/David

推荐答案

pi ************ @ gmail.com 写道:

我需要开发一个跨平台的文本模式应用程序。我想用
来用Python做这件事,我想用一个成熟的文本模式库

用于UI的东西。


我认为,显而易见的选择是ncurses。但据我所知,

它在Windows上不适用于Python?


有解决方法吗?或者是否有替代库可能会使用
代替(n)诅咒?我知道我可以在Windows上使用(n)诅咒* nix和

控制台等,但这当然不是最理想的。
I need to develop a cross-platform text-mode application. I would like
to do it in Python and I would like to use a mature text-mode library
for the UI stuff.

The obvious choice, I thought, was ncurses. But as far as I can tell,
it is not available for Python on Windows?

Is there a workaround? Or are there alternative libraries that might
be used instead of (n)curses? I know I can use (n)curses on *nix and
console on Windows etc., but that is of course suboptimal.



这个链接为控制台IO提供了一系列链接...
http://mail.python.org/pipermail/pyt...ry/303984.html


其中包含已经重新定位的''wcurses''模块的链接

这里: http://adamv.com/dev/python/curses/ 它实际上并不适用于

控制台,但似乎你可以为一个API编程。


总有cygwin + Python + ncurses。


- Josiah


This link offers a series of links for console IO...
http://mail.python.org/pipermail/pyt...ry/303984.html

Among them is a link to the ''wcurses'' module that has been relocated
here: http://adamv.com/dev/python/curses/ It doesn''t actually work in
the console, but it seems as though you can program towards one API.

There is always cygwin + Python + ncurses.

- Josiah


" pi ************ @ gmail.com" < pi ************ @ gmail.comwrites:
"pi************@gmail.com" <pi************@gmail.comwrites:

我认为,显而易见的选择是ncurses。但据我所知,b $ b告诉它,它不适用于Windows上的Python?
The obvious choice, I thought, was ncurses. But as far as I can
tell, it is not available for Python on Windows?



更确切地说,无论是否涉及到Python,curses都不会在Windows上本地工作。


与许多如何在Windows上获得Unix功能foo一样,一个答案

是下载并安装Cygwin< URL:http:// www。 cygwin.com/> ;.这个

为你提供了一个类似Unix的环境,你可以运行很多

的应用程序,包括依赖于curses的应用程序。


对于使用Python中的curses,您可能会发现Urwid库

很有帮助。 < URL:http://excess.org/urwid/>


-

\"那天晚上我在酒吧,从酒吧工具跳到|

` \ barstool,试图获得幸运,但其中没有任何口香糖。

_o__)其中任何一种。 - Emo飞利浦|

Ben Finney

More precisely, curses doesn''t work natively on Windows, regardless of
whether Python is involved.

As with many "how do I get Unix feature foo on Windows?", one answer
is to download and install Cygwin <URL:http://www.cygwin.com/>. This
gives you a Unix-like environment where you can run a great many
applications, including ones that depend on curses.

For working with curses in Python you might find the Urwid library
helpful. <URL:http://excess.org/urwid/>

--
\ "I was in a bar the other night, hopping from barstool to |
`\ barstool, trying to get lucky, but there wasn''t any gum under |
_o__) any of them." -- Emo Philips |
Ben Finney


我之前说过,我会再说一遍。为什么Python没有

平台中立命令来进行简单的屏幕操作? yabasic(

''业余爱好''类型语言 - http:// www.yabasic.de/ )命令清晰

屏幕,inkey
I''ve said it before and I''ll say it again. Why does Python have no
platform neutral commands for simple screen manipulation? yabasic (a
''hobby'' type language - http://www.yabasic.de/) has commands clear
screen, inkey


这篇关于Python和(n)诅咒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆