How to run another python script?

Discussion in 'Python' started by Dan Lee, Feb 14, 2011.

  1. Dan Lee

    Dan Lee Guest

    Hi.

    I just knew what python is.
    Now I'm about to write backup script.Now I got 2 scripts.

    AAA : generate zip file
    BBB : delete old file.

    AAA is done.
    Now I'm going to code BBB file. and I will fix AAA to call BBB to
    delete dump file at the end.
    Please let me know How can I call the BBB file from AAA file.

    Thanks in advance.
    Dan
    Dan Lee, Feb 14, 2011
    #1
    1. Advertising

  2. Dan Lee

    rantingrick Guest

    On Feb 14, 9:51 am, Dan Lee <> wrote:

    > AAA : generate zip file
    > BBB : delete old file.
    >
    > AAA is done.
    > Now I'm going to code BBB file. and I will fix AAA to call BBB to
    > delete dump file at the end.
    > Please let me know How can I call the BBB file from AAA file.


    Simple: Make a call using the underlying os from the aptly named "os"
    module (or other!). OR import BBB and execute the code.
    rantingrick, Feb 14, 2011
    #2
    1. Advertising

  3. Dan Lee wrote:
    > Hi.
    >
    > I just knew what python is.
    > Now I'm about to write backup script.Now I got 2 scripts.
    >
    > AAA : generate zip file
    > BBB : delete old file.
    >
    > AAA is done.
    > Now I'm going to code BBB file. and I will fix AAA to call BBB to
    > delete dump file at the end.
    > Please let me know How can I call the BBB file from AAA file.
    >
    > Thanks in advance.
    > Dan
    >

    In that case, code the delete function in AAA => No BBB file, problem
    solved.
    There is of course plenty of ways to execute BBB from AAA but that would
    be overkill.

    If you really want to write the BBB file, then write it, import it in
    AAA and call the BBB.deleteOldFile function.

    JM
    Jean-Michel Pichavant, Feb 14, 2011
    #3
    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. Replies:
    5
    Views:
    469
  2. Rajat
    Replies:
    3
    Views:
    689
    Jorgen Grahn
    Jan 8, 2010
  3. souleymane yo
    Replies:
    1
    Views:
    166
    Thomas Jollans
    Jul 23, 2011
  4. Robert Cohen
    Replies:
    3
    Views:
    265
    Andrew Durstewitz
    Jul 15, 2003
  5. 3lionz Wexler
    Replies:
    2
    Views:
    653
    Suraj Kurapati
    Aug 24, 2010
Loading...

Share This Page