string.digits, string.letters? How?

Paul Lim paullim at
Wed Oct 17 20:22:39 CEST 2001

Hi again to all,

I am a newbie in Python and please really pardon me for my trivial

How can we use the digits, letters variable in the string modules?

I have the following snippet of my code

# Import library modules
# ======================

import sys
from string import lower, find, atoi, digits, letters

if digits(sys.argv[i+1]):
   print "Invalid argument"

but i get the error message
  File "", line 32, in ?
    if digits(sys.argv[i+1]):
TypeError: object is not callable: '0123456789'

What is wrong?

Thank you very much.


More information about the Python-list mailing list