2013-05-13 92 views
1

我在家里写了2.7的python代码,但现在我试图修复它在2.4上运行在这里工作。麻烦移植python-2.7诅咒到python-2.4

首先是hline不适合我。我有

stdscr.hline(0,0,'=',5) 

但它只打印出一个=符号。

二是chgat不

screen.chgat(0,0,-1,curses.color_pair(2) 

工作,因为它返回AttributeError: chgat

不知道如何自

curses.curs_set(0)` doesn't work either.`enter code here` 

禁用游标我找不到诅咒的任何文件python 2.4.3所以我无法移植它。

+2

我知道这不是一个实际的解决方案,但考虑到移植不是代码,但古老的软件达在_least_ 2.6 ... 2.6以下的任何东西都被认为是** dead **! – Torxed 2013-05-13 18:30:25

+0

另外,哪个版本的'curses'(例如,'libncurses.so')是你的Python针对的?如果你有一个非常古老的库,或者针对不同库(在商业Unix中常见)的ncurses部分仿真,Python可以尽其所能地包装它,但有一些限制。 – abarnert 2013-05-13 18:37:26

+0

最后,'curses'过去被作为一个单独的包来维护,'python-curses',你可以单独安装以获得比python附带的更新版本(就像'sqlite3')。我不知道2.4.3之前是否停止了,但是从快速搜索我可以看到一些Linux发行版有'python-curses-2.6'或类似的包(例如[this one](http:// rpm.pbone.net/index.php3/stat/4/idpl/18246679/dir/opensuse/com/python-curses-2.6.5-3.3.1.i586.rpm.html)),这是一个好兆头。 – abarnert 2013-05-13 18:40:59

回答