I am trying from curses.ascii import *
to django project, but I get: No module named _curses
, I am using Python 2.5, any suggestion? Anyway I only need isalpha()
function to use....
Asked
Active
Viewed 5,132 times
0

IProblemFactory
- 9,551
- 8
- 50
- 66
-
1If this is on Windows, I don't think curses is supported by Python 2.5. – Dec 07 '09 at 22:55
-
Next question is why you are trying to use curses on windows ;) – John La Rooy Dec 07 '09 at 23:07
-
I need to use `isalpha()` only :) – IProblemFactory Dec 07 '09 at 23:29
-
strings already have an isalpha method. I've updated my answer – John La Rooy Dec 07 '09 at 23:38
1 Answers
3
You didn't say which platform you are on, but there is probably a package which will install the curses bindings for you.
In debian/ubuntu for example it is part of the default python install
If you built the Python yourself, you may be missing the libcurses-dev
If you are on windows maybe check out this wcurses package
Otherwise curses is not supported on windows however there is a Console module
Edit: since the OP is just using isalpha
Strings have their own isalpha() method already
>>> "Hello".isalpha()
True
>>> "World!".isalpha()
False
The one with curses only works on single characters
>>> from curses.ascii import isalpha
>>> all(isalpha(x) for x in "Hello")
True
>>> all(isalpha(x) for x in "World!")
False

John La Rooy
- 295,403
- 53
- 369
- 502
-
1Yay, still forget that everything is object... it works thanks :) – IProblemFactory Dec 08 '09 at 00:02