New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
curses for windows (alternative patch) #47138
Comments
Make curses available on Windows by using PDCurses library. Alternative Attached .bat file is used to compile it under MinGW, but I'd be glad to PDCurses includes support for mouse functions compatible with ncurses, Some functions, such as initterm are not available on Windows platform I hope that curses module will be included in next Python 2.6 |
The patch, in its current form, is incomplete. Can you please provide: a) a VS 2008 project file, which builds both the curses module and the |
Here's a patch against the head of trunk that adds vcproj files for With this, test_curses.py passes and I'm able to run all the curses |
I can't say anything about the Windows build aspects. Some observations
|
OK, fixed.
They're stubs in pdcurses that always return an error. I'm not sure
Yea, it was actually really easy to resolve the conflicts. I've done
PDCurses does the same thing for setupterm as it does for putp/tparm |
I've built a package for python 2.6 using a slightly modified version of I'm attaching my version of the patch here. I had to make two
With this package, I've been able to run the Mercurial "crecord" |
Any progress yat? |
It can't go into 2.x anymore. |
Brian or Tim any interest in this? |
I'll pick it up for the moment to shepherd it along because I'm reasonably keen to see a Windows curses in the stdlib. However, I'm no expert in curses and I don't promise to do anything immediate with it. |
-1 for PDCurses |
I have no strong opinion, Roumen, (and no experience with the package) |
Recent ncurses pass python tests with only one small update (part of patch to bpo-3871): --- ./Lib/test/test_curses.py.MINGW 2010-08-09 00:03:48.000000000 +0300
+++ ./Lib/test/test_curses.py 2010-08-09 00:05:38.000000000 +0300
@@ -167,11 +167,16 @@
curses.delay_output(1)
curses.echo() ; curses.echo(1)
- f = tempfile.TemporaryFile()
+ fx = tempfile.TemporaryFile()
+ # cf tempfile.py TemporaryFile vs NamedTemporaryFile
+ if os.name != 'posix' or os.sys.platform == 'cygwin':
+ f = fx.file
+ else:
+ f = fx
stdscr.putwin(f)
f.seek(0)
curses.getwin(f)
- f.close()
+ fx.close()
curses.halfdelay(1)
curses.intrflush(1) ===================================== Also PDCurses is not updated since 2008. |
PDCurses is not updated, because it is considered stable and mature library that has been tested on Windows platform by many roguelikes. I doubt that ncurses hackers care about Windows compatibility more than just to make it run. |
What is the status of this bug? I tried to build the svn trunk with patches provided by zhirsch but I had problems applying the patches. I went ahead and made a new patch which is pretty similar to the earlier patch (mentioned above). The one change is that I implemented mkstemp() so putwin() and getwin() work. |
Curses binaries for Python 2.5, 2.6, 2.7, 3.1 and 3.2, win32 and win-amd64, are available at <http://www.lfd.uci.edu/~gohlke/pythonlibs/#curses\>. |
@Christoph Gohlke any chance of providing a build for 3.3? |
Can this be closed as curses binaries for Python 2.5, 2.6, 2.7, 3.1, 3.2, 3.3 and 3.4, win32 and win-amd64, are available at <http://www.lfd.uci.edu/~gohlke/pythonlibs/#curses\>, plus there is also https://pypi.python.org/pypi/UniCurses/1.2 ? |
Python is supposed to be cross platform. This has been a major incompatibility issue between Windows and *nix and you think this patch, which has been ready for nearly 7 years now, should simply get discarded because the fix is available from pip? I think there are two possible remedies to this:
|
This patch is a huge improvement over the current situation, which is we don't have a cross-platform curses implementation in the standard library. The alternatives listed by Mark aren't sufficient. For the two reasons given below:
Conclusion: |
The patch would need updating to be applicable. Minimum changes I would expect to be required:
That's quite a lot of changes, in practice. Unless someone is going to step up and do all of that (and keep it maintained until it gets merged, which probably won't be till 3.6) *and* there's one of the core devs willing to support the code going forward once its committed, then I think closing this as "won't fix" and referring to the external packages is the best solution. A documentation patch to https://docs.python.org/3.4/howto/curses.html ("Curses programming with Python") which explained how to set up one of the external curses modules on Windows, and how to write cross-platform code that uses the core implementation on Unix and the 3rd party module on Windows, would be immensely useful for people interested in this patch. Probably far more so than pushing for this patch to go in, in all honesty, as it's easier to do and would be useful to people on older versions of Python as well. |
Just as an FYI, there is a repository for building curses wheels for Windows at https://github.com/zephyrproject-rtos/windows-curses, based on patches from here and Gohlke's work. Building wheels is less straightforward than it used to be, e.g. due to term.h disappearing from PDCurses. We also make wheels available on PyPI. |
Current ncurses master is buildable on Visual Studio, using msys2. It should be possible to create a vcxproject and integrate it in the Visual Studio build. |
+1 Also, the windows-curses package seems to be fairly up to date for those who want to use PDCurses on Windows. |
Closing as windows-curses exists, and per Paul & Erlend. If someone would like to do the work to implement curses on windows, we could re-open this issue or discuss in a new one (referencing 3.12+ rather than 3.6!) A |
Windows-curses quit silently on Cpython3.12. is it possible to reopen this issue? |
@AA-Turner |
See also #40725. |
that one seems not for MSVC compiler. Could I directly try this patch? |
I'm not sure which patch you are referring to, but I'd expect all the attached files both in this issue and #40725 to be seriously outdated; I would not expect any of these to merge cleanly into |
FWIW, I moved the code and build script used for https://www.lfd.uci.edu/~gohlke/pythonlibs/#curses to https://github.com/cgohlke/python-curses-build |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: