Jon wrote:
As far as I can tell from the online docs, "capwords" should be defined in
the built-in "regex" module. Why is it telling me that capwords is not
defined?
Hmm... are you looking instead for "capwords" from the string module?
>>> s = """\
... Well, he's...
... he's, ah...
... probably pi
Jon wrote:
The following four lines of code:
import sys, os, re
sentence = raw_input("Enter a sentence: ")
capwords (sentence)
print sentence
gives me the following error: NameError: name 'capwords' is not defined
As far as I can tell from the online docs, "capwords" should be defined in
the buil
Is it in "regex" or "re"? If in "re" then:
re.capwords(sentence)
If in "regex", then:
regex.capwords(sentence)
You can also do
from re import *
then you will not have to prefix. But careful not to clutter your namespace.
On Friday 10 December 2004 10:29 am, Jon wrote:
> Hi,
>
> The followin
Title: RE: [Newby] question about modules
[Jon]
#- gives me the following error: NameError: name 'capwords' is
#- not defined
#-
#- As far as I can tell from the online docs, "capwords" should
#- be defined in
#- the built-in "regex" module. Why is it t
Hi,
The following four lines of code:
import sys, os, re
sentence = raw_input("Enter a sentence: ")
capwords (sentence)
print sentence
gives me the following error: NameError: name 'capwords' is not defined
As far as I can tell from the online docs, "capwords" should be defined in
the built-i