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


Groups > comp.lang.python > #12905

Re: How to structure packages

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rafadurancastaneda@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.027
X-Spam-Evidence '*H*': 0.95; '*S*': 0.00; 'python': 0.08; 'url:peps': 0.09; 'did,': 0.16; 'myclass': 0.16; 'url:pep-0008': 0.16; 'wrote:': 0.16; 'received:74.125.82.174': 0.19; 'received:mail- wy0-f174.google.com': 0.19; 'header:In-Reply-To:1': 0.22; 'received:192.168.1.100': 0.23; "shouldn't": 0.23; 'writes:': 0.25; 'import': 0.28; 'url:dev': 0.30; 'modules': 0.31; 'to:addr :python-list': 0.33; 'named': 0.33; '...': 0.34; 'header:User- Agent:1': 0.34; 'message-id:@gmail.com': 0.34; 'like:': 0.34; 'from:charset:iso-8859-1': 0.35; 'subject:How': 0.35; 'url:python': 0.36; 'something': 0.37; 'received:74.125.82': 0.38; 'received:google.com': 0.38; 'url:org': 0.38; 'should': 0.38; 'subject:: ': 0.39; 'received:192': 0.39; 'to:addr:python.org': 0.39; 'received:74.125': 0.39; 'john': 0.62
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=joV4GVwZMI9WT8hyXj+j54RqGElQcJm7X2JS4PGxfoI=; b=PfgHrZ0onJBZ2i1UOl31TaUHmnrELfV3IcvCkYR1s2V6KajLOz0tAauZhISp4S2LyE o//I7NXMjG+AyvH6rnkFvLP99xQGGYK8JXEopjuXd+lv0xssJ0QqdvBj0/WmTchM8lqn cIwmfKhg9s8JIEPdsvH9iDsBV7OAYhhTz4CDg=
Date Wed, 07 Sep 2011 19:18:43 +0200
From Rafael Durán Castañeda <rafadurancastaneda@gmail.com>
User-Agent Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.20) Gecko/20110805 Thunderbird/3.1.12
MIME-Version 1.0
To python-list@python.org
Subject Re: How to structure packages
References <2a4f542c-a8c1-46c7-9899-a3fad0940cf6@x11g2000yqc.googlegroups.com> <j4852v$q77$1@reader1.panix.com>
In-Reply-To <j4852v$q77$1@reader1.panix.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.841.1315415927.27778.python-list@python.org> (permalink)
Lines 25
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1315415927 news.xs4all.nl 2546 [2001:888:2000:d::a6]:43331
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:12905

Show key headers only | View raw


Check python pep8: http://www.python.org/dev/peps/pep-0008/

And you will see than you shouldn't named modules as you did, so you 
should do something like:

mypackage
     __init__.py
     mymodule
     ...

mypackage.mymodule.MyClass

On 07/09/11 18:11, John Gordon wrote:
> In<2a4f542c-a8c1-46c7-9899-a3fad0940cf6@x11g2000yqc.googlegroups.com>  bclark76<bclark76@gmail.com>  writes:
>
>> mypackage
>>      __init__.py
>>      myfunc.py
>>      MyClass.py
>> from mypackage import MyClass
> Try this instead:
>
>    from mypackage.MyClass import MyClass
>

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


Thread

How to structure packages bclark76 <bclark76@gmail.com> - 2011-09-07 08:56 -0700
  Re: How to structure packages John Gordon <gordon@panix.com> - 2011-09-07 16:11 +0000
    Re: How to structure packages Rafael Durán Castañeda <rafadurancastaneda@gmail.com> - 2011-09-07 19:18 +0200
  Re: How to structure packages Peter Otten <__peter__@web.de> - 2011-09-07 19:30 +0200
    Re: How to structure packages Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-09-08 10:29 +1000
      Re: How to structure packages Chris Angelico <rosuav@gmail.com> - 2011-09-08 12:39 +1000
      Re: How to structure packages Dan Sommers <dan@tombstonezero.net> - 2011-09-08 09:51 +0000
      Re: How to structure packages Jonathan Hartley <tartley@tartley.com> - 2011-09-08 03:22 -0700
      Re: How to structure packages Nobody <nobody@nowhere.com> - 2011-09-09 01:45 +0100
        Re: How to structure packages Chris Angelico <rosuav@gmail.com> - 2011-09-09 11:37 +1000
          Re: How to structure packages Nobody <nobody@nowhere.com> - 2011-09-10 11:11 +0100
            Re: How to structure packages Chris Angelico <rosuav@gmail.com> - 2011-09-10 20:29 +1000
            Re: How to structure packages "Littlefield, Tyler" <tyler@tysdomain.com> - 2011-09-10 08:04 -0600
        Re: How to structure packages Alec Taylor <alec.taylor6@gmail.com> - 2011-09-10 02:38 +1000
  Re: How to structure packages rantingrick <rantingrick@gmail.com> - 2011-09-07 10:56 -0700
  Re: How to structure packages "Littlefield, Tyler" <tyler@tysdomain.com> - 2011-09-07 12:11 -0600
  Re: How to structure packages Westley Martínez <anikom15@gmail.com> - 2011-09-07 14:35 -0700

csiph-web