How to run another python script?

D

Dan Lee

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
 
R

rantingrick

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.
 
J

Jean-Michel Pichavant

Dan said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,135
Latest member
VeronaShap
Top