python app import guidelines

Tim Chavez timrchavez at gmail.com
Wed Sep 22 18:00:31 UTC 2010


Stephen,

Maybe using a PYTHONPATH (or sys.path.append())  to specify the
top-level of your package and then touch'ing __init__py's in all the
directories leading to importable packages?  Maybe I've misunderstood
the question though...

-tim

On Wed, Sep 22, 2010 at 12:43 PM, Stephen Burke
<steve.burke.56 at gmail.com> wrote:
> I am packaging up a python app to upload it to my PPA eventually.
> Before this everything I have written is in one directory so all my
> imports were simple.  Now that I am breaking up the app and the top
> level script is in a "bin" directory and the helper scripts are in a
> "helpers" directory on the same level.  How should my imports be with
> this directory structure.  Would I modify the PYTHONPATH to add any
> directories I need or is there a better way to do this?  I have read
> python docs about imports but I'm wondering if there are any more
> guidelines in terms of imports for python apps that are packaged for
> Ubuntu.
>
> Any help would be appreciated.
>
> Steve
>
> --
> Ubuntu-devel-discuss mailing list
> Ubuntu-devel-discuss at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss
>



-- 
-tim




More information about the Ubuntu-devel-discuss mailing list