Distutils: blurring the file==module borders

Discussion in 'Python' started by Frans Englich, Jan 25, 2005.

  1. Hello all,

    Due to the size of my source, I want to split it up into multiple
    files(basically one class in each file), but then I have difficulties with
    the directory layout when the modules are installed with distutils.

    This is my file layout:

    in ./ I have a setup.py which has 'packages="foo"'

    in ./foo/ I have an __init__.py and a handful of files named ClassA.py,
    ClassB.py, ClassC.py and so forth.

    The problem is that when installed, in order to reach, say, classB, I need to
    do:

    import foo.ClassA

    var = foo.ClassA.ClassA()

    while I want to do var = foo.ClassA()

    In other words, the result I want can be achieved by putting all code in
    __init__.py. The problem is that I would find it horrible to have all code in
    one file.

    Python have this one-to-one relationship between modules and files; can what I
    want somehow be achieved?


    Cheers,

    Frans
    Frans Englich, Jan 25, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. George
    Replies:
    9
    Views:
    4,873
    George
    Oct 25, 2004
  2. slayer_azure
    Replies:
    7
    Views:
    308
  3. Luis Alberto Zarrabeitia Gomez

    distutils, No module named numpy.distutils.fcompiler.conv_template

    Luis Alberto Zarrabeitia Gomez, Mar 30, 2009, in forum: Python
    Replies:
    0
    Views:
    1,288
    Luis Alberto Zarrabeitia Gomez
    Mar 30, 2009
  4. santonvegas
    Replies:
    3
    Views:
    906
    santonvegas
    Mar 23, 2010
  5. Terry Michaels

    Calculating simulated motion blurring

    Terry Michaels, Jan 30, 2011, in forum: Ruby
    Replies:
    0
    Views:
    82
    Terry Michaels
    Jan 30, 2011
Loading...

Share This Page