0

I'm converting a Bash script to Python. I have been looking for a replacement for the "make install" - line. Is there any?

print "Installing from the sources"
urllib.urlretrieve("http://"+backupserver+"/backup-manager.tar.gz","backup-manager.tar.gz")
tar = tarfile.open("backup-manager.tar.gz", "r:gz")
tar.extractall()    
tar.close() 
os.chdir("Backup-Manager-0.7.10")
make install

3 Answers 3

2
import subprocess

subprocess.call(['make', 'install'])

Should do the trick.

If you want the output look at this

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! I had tried with check_call, didn't even consider this method.
1

You can use subprocess

or else

import os
os.system("make install")

Some information about Calling an external command in Python

1 Comment

Oh, you could do that too? I'll check it out, thanks!
0

use subprocess to run other programs from Python.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.