Paddelui
Paddelui

Reputation: 37

"make install" with Python

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

Upvotes: 0

Views: 1039

Answers (3)

semptic
semptic

Reputation: 654

import subprocess

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

Should do the trick.

If you want the output look at this

Upvotes: 2

Naive
Naive

Reputation: 512

You can use subprocess

or else

import os
os.system("make install")

Some information about Calling an external command in Python

Upvotes: 1

Jayesh Bhoi
Jayesh Bhoi

Reputation: 25865

use subprocess to run other programs from Python.

Upvotes: 0

Related Questions