Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python Curses initscr Error

Tags:

python

curses

I'm trying to initiate

screen = curses.initscr()

But it failed and returns

File "C:\Python32\lib\curses\__init__.py", line 31, in initscr
fd=_sys.__stdout__.fileno())
AttributeError: 'NoneType' object has no attribute 'fileno'

Here's my system Python 3.2.3 (default, Apr 11 2012, 07:12:16) [MSC v.1500 64 bit (AMD64)] on win32

This is my first time running python on this computer, it's Windows 7 64bit.

Is this has something to do with my OS? Anyway I can solve this?

like image 483
Randize Avatar asked Sep 23 '26 18:09

Randize


1 Answers

You can't use the curses module on Windows; apparently there are DOS and OS/2 ports but it is primarily a POSIX-only library.

You'll have to use a Windows-specific port such as wcurses, a third-party project that supports Windows too such as PDCurses, or you could try the console module (the latter drives the Windows CMD console in a similar manner).

like image 126
Martijn Pieters Avatar answered Sep 26 '26 09:09

Martijn Pieters



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!