What is needed for curses in Python 3.4 on Windows7?

谁说胖子不能爱 提交于 2019-11-27 01:24:46
vgonisanz

You can use curses cross-platform (Windows, MacOS, GNU/Linux) if you install manually for Windows or like other package in others.

  1. Install wheel package. If you need more info about wheel click here.

  2. Go to this repository.

  3. Download a package with your python version, in example for python 3.4:

    curses-2.2-cp34-none-win_amd64.whl
    
  4. Install it (this command if for windows, in GNU/Linux install like other package)

    python -m pip install curses-2.2-cp34-none-win32.whl
    
  5. Just include in your python script:

    import curses 
    

You can use curses wrapper for python. Works in Fedora 25 in all terminals, and Windows 10 using git bash, powershell, or cmd.

Update:

  • An alternative to curses in Windows here.
  • Console user interface in Windows here.
  • An interesting tutorial here.

You can try my mirror of unicurses, which includes pdcurses dlls. I have it currently up and running on windows 7 with python 3.5.0.

To quickly test if it works for you, just clone the repository and create and run a python script within its toplevel directory containing something like

from unicurses import *
stdscr = initscr()
addstr("hello world")
getch()

Now we can easy install on python 3.7 using pip install windows-curses

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!