string.digits, string.letters? How?

Paul Lim paullim at starhub.net.sg
Wed Oct 17 14:22:39 EDT 2001


Hi again to all,

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

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 "test.py", line 32, in ?
    if digits(sys.argv[i+1]):
TypeError: object is not callable: '0123456789'

What is wrong?

Thank you very much.

Sincerely
Paul




More information about the Python-list mailing list