Distribute Non Library

Discussion in 'Python' started by narke, Sep 12, 2010.

  1. narke

    narke Guest

    My simple tool writing in python get bigger and bigger and I think I'd
    better split my code into several files. But, unlike what in some other
    languages, there is no way to compile these several files into a single
    executable. Before I splitting my simple tool program, I just put it in
    /usr/local/bin and run, very simple. Now I have to consider distribute
    a lot of files in a whole. I know distutils can help, but I feel it is
    a little uncomfortable, since I am not sharing a library, I am not
    sharing any thing. I just want to refactory my code. Is there a better
    solution to my case? Can I simply create a directory in /usr/local/bin
    and put my script and other used files into the directory? Does
    distutils help in this case?

    Thanks in advance.

    --
    Life is the only flaw in an otherwise perfect nonexistence
    -- Schopenhauer

    narke
    narke, Sep 12, 2010
    #1
    1. Advertising

  2. narke

    Glazner Guest

    On Sep 12, 5:10 am, narke <> wrote:
    > My simple tool writing in python get bigger and bigger and I think I'd
    > better split my code into several files.  But, unlike what in some other
    > languages, there is no way to compile these several files into a single
    > executable. Before I splitting my simple tool program, I just put it in
    > /usr/local/bin and run, very simple.  Now I have to consider distribute
    > a lot of files in a whole.  I know distutils can help, but I feel it is
    > a little uncomfortable, since I am not sharing a library, I am not
    > sharing any thing. I just want to refactory my code.  Is there a better
    > solution to my case?  Can I simply create a directory in /usr/local/bin
    > and put my script and other used files into the directory?  Does
    > distutils help in this case?
    >
    > Thanks in advance.


    try :
    python mayApp.zip

    myApp.zip <--> all your files + a __main__.py file as a starting
    point...
    Glazner, Sep 12, 2010
    #2
    1. Advertising

  3. narke <> writes:

    > My simple tool writing in python get bigger and bigger and I think I'd
    > better split my code into several files. But, unlike what in some other
    > languages, there is no way to compile these several files into a single
    > executable. Before I splitting my simple tool program, I just put it in
    > /usr/local/bin and run, very simple. Now I have to consider distribute
    > a lot of files in a whole. I know distutils can help, but I feel it is
    > a little uncomfortable, since I am not sharing a library, I am not
    > sharing any thing. I just want to refactory my code. Is there a better
    > solution to my case? Can I simply create a directory in /usr/local/bin
    > and put my script and other used files into the directory? Does
    > distutils help in this case?


    Consider using setuptools + console entry points. With these, you will
    automatically generate a shell-script to execute for your otherwise
    eggified and easy installable package.

    Diez
    Diez B. Roggisch, Sep 12, 2010
    #3
  4. narke

    CM Guest

    On Sep 11, 11:10 pm, narke <> wrote:
    > My simple tool writing in python get bigger and bigger and I think I'd
    > better split my code into several files.  But, unlike what in some other
    > languages, there is no way to compile these several files into a single
    > executable.


    Sure there is. py2exe, py2app, cx_freeze, etc.
    CM, Sep 12, 2010
    #4
  5. narke <> writes:

    > On 2010-09-12, Glazner <> wrote:
    >> On Sep 12, 5:10 am, narke <> wrote:
    >>> My simple tool writing in python get bigger and bigger and I think I'd
    >>> better split my code into several files.  But, unlike what in some other
    >>> languages, there is no way to compile these several files into a single
    >>> executable. Before I splitting my simple tool program, I just put it in
    >>> /usr/local/bin and run, very simple.  Now I have to consider distribute
    >>> a lot of files in a whole.  I know distutils can help, but I feel it is
    >>> a little uncomfortable, since I am not sharing a library, I am not
    >>> sharing any thing. I just want to refactory my code.  Is there a better
    >>> solution to my case?  Can I simply create a directory in /usr/local/bin
    >>> and put my script and other used files into the directory?  Does
    >>> distutils help in this case?
    >>>
    >>> Thanks in advance.

    >>
    >> try :
    >> python mayApp.zip
    >>
    >> myApp.zip <--> all your files + a __main__.py file as a starting
    >> point...

    >
    > looks also not decent :( i want my tool appear as an executabe, not an
    > zip. but thank you anyway.


    Again:

    http://www.5dollarwhitebox.org/drupal/node/75

    Diez
    Diez B. Roggisch, Sep 12, 2010
    #5
  6. narke

    narke Guest

    On 2010-09-12, Diez B. Roggisch <> wrote:
    > narke <> writes:
    >
    >> My simple tool writing in python get bigger and bigger and I think I'd
    >> better split my code into several files. But, unlike what in some other
    >> languages, there is no way to compile these several files into a single
    >> executable. Before I splitting my simple tool program, I just put it in
    >> /usr/local/bin and run, very simple. Now I have to consider distribute
    >> a lot of files in a whole. I know distutils can help, but I feel it is
    >> a little uncomfortable, since I am not sharing a library, I am not
    >> sharing any thing. I just want to refactory my code. Is there a better
    >> solution to my case? Can I simply create a directory in /usr/local/bin
    >> and put my script and other used files into the directory? Does
    >> distutils help in this case?

    >
    > Consider using setuptools + console entry points. With these, you will
    > automatically generate a shell-script to execute for your otherwise
    > eggified and easy installable package.
    >
    > Diez


    That's really attracting. I will try, thanks!

    --
    Life is the only flaw in an otherwise perfect nonexistence
    -- Schopenhauer

    narke
    test post
    narke, Sep 13, 2010
    #6
  7. narke

    narke Guest

    On 2010-09-12, CM <> wrote:
    > On Sep 11, 11:10 pm, narke <> wrote:
    >> My simple tool writing in python get bigger and bigger and I think I'd
    >> better split my code into several files.  But, unlike what in some other
    >> languages, there is no way to compile these several files into a single
    >> executable.

    >
    > Sure there is. py2exe, py2app, cx_freeze, etc.


    Also good solution! Thanks for the help. And, cx_freeze looks even
    workable on my Linux. Great.

    --
    Life is the only flaw in an otherwise perfect nonexistence
    -- Schopenhauer

    narke
    test post
    narke, Sep 13, 2010
    #7
    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. Shrinivas
    Replies:
    4
    Views:
    2,441
    Jerry III
    Aug 21, 2003
  2. lh
    Replies:
    2
    Views:
    458
  3. Tina
    Replies:
    1
    Views:
    290
    bruce barker
    Jan 13, 2005
  4. =?Utf-8?B?Sm9obiBCYWlsZXk=?=

    Can you still indicate to distribute files locally in ASP.Net 2.0

    =?Utf-8?B?Sm9obiBCYWlsZXk=?=, Jun 16, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    362
    =?Utf-8?B?Sm9obiBCYWlsZXk=?=
    Jun 16, 2005
  5. Zed A. Shaw
    Replies:
    5
    Views:
    97
    Dido Sevilla
    Mar 26, 2005
Loading...

Share This Page