>> 'next sentence' is the operative piece. I think that if the bit
>> about placement was moved to the end of the paragraph the whole
>> thing would be more readable and I wouldn't have stumbled on it.
>
> If it had meant "the imported module's names" or indeed "the imported
> modules' names", I
On 15/09/17 18:05, Tobiah wrote:
On 09/15/2017 09:25 AM, Stefan Ram wrote:> Tobiah writes:
Modules can import other modules. It is customary but not
required to place all import statements at the beginning
of a module (or script, for that matter). The imported
mo
On 09/15/2017 09:25 AM, Stefan Ram wrote:> Tobiah writes:
>> Modules can import other modules. It is customary but not
>> required to place all import statements at the beginning
>> of a module (or script, for that matter). The imported
>> module names are placed
> ..
>> When i
Re-reading I guess the plural refers to the multiple modules
referenced in the first sentence. It was probably written that
way before someone inserted the bit about the customary placement,
which greatly clouds the connection.
On 09/15/2017 09:03 AM, Tobiah wrote:
> In this doc:
>
> ht
On Sat, Sep 16, 2017 at 2:03 AM, Tobiah wrote:
> It seems that if the statement read:
>
> the imported module's name (singular) is placed in the
> importing module's global symbol table.
>
> That it would be more accurate.
That implies that you only import one module. Consider:
i
In this doc:
https://docs.python.org/2/tutorial/modules.html
Near the top it states:
Modules can import other modules. It is customary but not
required to place all import statements at the beginning
of a module (or script, for that matter). The imported
m
Hi All,
A question about embedding:
If I take the example code on embedding (Section 5.3 of Extending and
Embedding the Python Interpreter 2.4) and add the lines:
PyRun_SimpleString("import sys");
PyRun_SimpleString("print globals()");
Just after the part where the code loads the module, and th
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
Jon wrote:
> Hi Jeff,
>
> That makes sense -- thanks. However now when I use "re.capwords (sentence)"
> I get a different error message:
>
> AttributeError: 'module' object has no attribute 'capwords'
>
> Each of the other two suggested implimentations produce a similar error
> message. Is the
Hi Jeff,
That makes sense -- thanks. However now when I use "re.capwords (sentence)"
I get a different error message:
AttributeError: 'module' object has no attribute 'capwords'
Each of the other two suggested implimentations produce a similar error
message. Is there something even more basic
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
Jon writes:
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 defi
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
15 matches
Mail list logo