Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #57896

Re: Organising packages/modules - importing functions from a common.py in a separate directory?

Date 2013-10-29 10:02 +0100
From Jean-Michel Pichavant <jeanmichel@sequans.com>
Subject Re: Organising packages/modules - importing functions from a common.py in a separate directory?
Newsgroups comp.lang.python
Message-ID <mailman.1751.1383037359.18130.python-list@python.org> (permalink)

Show all headers | View raw


----- Original Message -----
> Hi,
> 
> If I try to use:
> 
>     from .common.common_foo import setup_foo_logging
> 
> I get:
> 
>     ValueError: Attempted relative import in non-package

If you're using python 3, forget what I said about not using relative imports. I think they've implemented the necessary grammar to make it work.

Cheers,

JM


-- IMPORTANT NOTICE: 

The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Organising packages/modules - importing functions from a common.py in a separate directory? Jean-Michel Pichavant <jeanmichel@sequans.com> - 2013-10-29 10:02 +0100

csiph-web