Re: why have to "from compiler import *"

2006-09-05 Thread Paddy
Duncan Booth wrote: > "Paddy" <[EMAIL PROTECTED]> wrote: > > > > > import module1 > > # namespace becomes: > >\-/ > > |module1.moduleFunc1 | > > |module1.moduleClass1: | > > | class1Method1 | > > | class1Method2 | > > |module1.moduleFu

Re: why have to "from compiler import *"

2006-09-05 Thread Duncan Booth
"Paddy" <[EMAIL PROTECTED]> wrote: > > import module1 > # namespace becomes: >\-/ > |module1.moduleFunc1 | > |module1.moduleClass1: | > | class1Method1 | > | class1Method2 | > |module1.moduleFunc2 | > |module1.moduleVar1 |

Re: why have to "from compiler import *"

2006-09-05 Thread Paddy
[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

Re: why have to "from compiler import *"

2006-09-05 Thread Bruno Desthuilliers
[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,

Re: why have to "from compiler import *"

2006-09-04 Thread John Purser
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 >

why have to "from compiler import *"

2006-09-04 Thread mark_galeck_spam_magnet
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