python中跨平台控制台应用程序的类curses库 [英] curses-like library for cross-platform console app in python

查看:17
本文介绍了python中跨平台控制台应用程序的类curses库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究用 python 开发一个控制台应用程序,它应该能够在 Windows 和 Linux 下运行.为此,我真的很想使用像 curses 这样的高级控制台库.但是,据我所知,curses 在 Windows 上不可用.

I'm looking into developing a console application in python which should be able to run under Windows as well as Linux. For this, I'd really like to use a high-level console library like curses. However, as far as I know, curses is not available on Windows.

我还有什么其他选择?不幸的是,在 Windows 下使用 cygwin 不是一种选择...

What other options do I have? Unfortunately, using cygwin under Windows is not an option...

感谢您的帮助!

推荐答案

有一个wcurses.我从未尝试过,但它可能会满足您的需求.听起来它没有完全的诅咒兼容性,但可能足够接近.此外,它可能不是使用 DOS 终端,而是打开一个 GUI 窗口并在其中绘制等宽文本.

There is a wcurses. I've never tried it but it may meet your needs. It sounds like it doesn't have full curses compatibility, but may be close enough. Also it might not be using the DOS terminal, but opening a GUI window and drawing monospaced text inside.

其他 windows 文本模式选项有:

Other windows text mode options are:

  • The console module;
  • wconio -- based on Borland's C conio library.

我相信两者都只是窗户.

I believe both are windows only.

这篇关于python中跨平台控制台应用程序的类curses库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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