Duncan Booth wrote:
> "Paddy" <[EMAIL PROTECTED]> wrote:
>
> >
> > import module1
> > # namespace becomes:
> >\-/
> > |module1.moduleFunc1 |
> > |module1.moduleClass1: |
> > | class1Method1 |
> > | class1Method2 |
> > |module1.moduleFu
"Paddy" <[EMAIL PROTECTED]> wrote:
>
> import module1
> # namespace becomes:
>\-/
> |module1.moduleFunc1 |
> |module1.moduleClass1: |
> | class1Method1 |
> | class1Method2 |
> |module1.moduleFunc2 |
> |module1.moduleVar1 |
[EMAIL PROTECTED] wrote:
> Hi, why does
>
> >>> import compiler
> >>> compileFile("foo.py")
>
> complain name 'compileFile' not defined. But
>
> >>>from compiler import *
>
> works. Why? (I did read the tutorial, it seems to say "import module"
> should work.
>
> Thank you, Mark
I did some as
[EMAIL PROTECTED] wrote:
> Hi, why does
>
import compiler
compileFile("foo.py")
>
> complain name 'compileFile' not defined.
Probably because it's not ?
import imports the name in the current
namespace. Then let you access all the names defined in
namespace. So in you're case,
On Mon, 2006-09-04 at 21:40 -0700, [EMAIL PROTECTED]
wrote:
> Hi, why does
>
> >>> import compiler
> >>> compileFile("foo.py")
>
> complain name 'compileFile' not defined. But
Because 'compileFile' is not defined. But I think you'll find that
compiler.compileFile IS defined.
John Purser
>
Hi, why does
>>> import compiler
>>> compileFile("foo.py")
complain name 'compileFile' not defined. But
>>>from compiler import *
works. Why? (I did read the tutorial, it seems to say "import module"
should work.
Thank you, Mark
--
http://mail.python.org/mailman/listinfo/python-list