Thanks to all for the answers!
:)
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
On Tue, 06 Oct 2009 21:44:35 -0400, Dave Angel wrote:
I'm surprised to see you missed this. A module doesn't generally import
itself, but it's an easy mistake for a circular dependency to develop
among modules.
Circular imports are always a difficulty. That has
On Tue, 06 Oct 2009 21:44:35 -0400, Dave Angel wrote:
> I'm surprised to see you missed this. A module doesn't generally import
> itself, but it's an easy mistake for a circular dependency to develop
> among modules.
Circular imports are always a difficulty. That has nothing to do with
making m
Steven D'Aprano wrote:
On Tue, 06 Oct 2009 18:42:16 +0200, Diez B. Roggisch wrote:
The most common problem is that a file is used as module and as
executable at the same time.
Like this:
--- test.py ---
class Foo(object):
pass
if __name__ == "__main__":
import test
assert Foo
On Tue, 06 Oct 2009 17:01:41 -0700, Carl Banks wrote:
>> Why would a module need to import itself? Surely that's a very rare
>> occurrence -- I think I've used it twice, in 12 years or so. I don't
>> see why you need to disparage the idea of combining modules and scripts
>> in the one file because
On Oct 6, 3:56 pm, Steven D'Aprano
wrote:
> On Tue, 06 Oct 2009 18:42:16 +0200, Diez B. Roggisch wrote:
> > The most common problem is that a file is used as module and as
> > executable at the same time.
>
> > Like this:
>
> > --- test.py ---
>
> > class Foo(object):
> > pass
>
> > if __name_
On Tue, 06 Oct 2009 18:42:16 +0200, Diez B. Roggisch wrote:
> The most common problem is that a file is used as module and as
> executable at the same time.
>
> Like this:
>
> --- test.py ---
>
> class Foo(object):
> pass
>
>
> if __name__ == "__main__":
>import test
>assert Foo i
Ethan Furman wrote:
> Greetings!
>
> I'm working on a package with multiple modules (and possibly packages),
> and I would like to do it correctly. :)
>
> I have read of references to possible issues regarding a module being
> imported (and run) more than once, but I haven't been able to find
>
Thanks. Found that 10 minutes after I sent.
On Feb 6, 2008, at 4:57 AM, Diez B. Roggisch wrote:
> Sean Allen wrote:
>
>> ok, what am i doing wrong?
>>
>> in current working directory i have:
>>
>> t.py
>> sub/t1.py
>>
>> t.py is:
>>
>> import sub.t1
>>
>> i get:
>>
>> ImportError: No module named
Sean Allen wrote:
> ok, what am i doing wrong?
>
> in current working directory i have:
>
> t.py
> sub/t1.py
>
> t.py is:
>
> import sub.t1
>
> i get:
>
> ImportError: No module named sub.t1
>
> t.py is
>
> import sub
>
> i get:
>
> ImportError: No module named sub.t1
>
> --
>
> i am o
Sean Allen wrote:
> ok, what am i doing wrong?
>
> in current working directory i have:
>
> t.py
> sub/t1.py
>
> t.py is:
>
> import sub.t1
>
> i get:
>
> ImportError: No module named sub.t1
>
> t.py is
>
> import sub
>
> i get:
>
> ImportError: No module named sub.t1
>
> --
>
> i am ob
On Oct 22, 1:24 pm, Peter Otten <[EMAIL PROTECTED]> wrote:
> Phoe6 wrote:
> > Hi all,
> > I have the following directory structure:
>
> > wallpaper/
> > -main.py
> > -ng/
> > -- __init__.py
> > -- setdesktop.py
> > -yb/
> >
Phoe6 wrote:
> Hi all,
> I have the following directory structure:
>
> wallpaper/
> -main.py
> -ng/
> -- __init__.py
> -- setdesktop.py
> -yb/
> -- __init__.py
> -- setdesktop.py
>
>>Fro
Phoe6 wrote:
> Hi all,
> I have the following directory structure:
>
> wallpaper/
> -main.py
> -ng/
> -- __init__.py
> -- setdesktop.py
> -yb/
> -- __init__.py
> -- setdesktop.py
>
>>Fro
14 matches
Mail list logo