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
Paddelui
  • 37
  • 1
  • 2
  • 9

3 Answers3

2
import subprocess

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

Should do the trick.

If you want the output look at this

Community
  • 1
  • 1
semptic
  • 615
  • 4
  • 14
1

You can use subprocess

or else

import os
os.system("make install")

Some information about Calling an external command in Python

Community
  • 1
  • 1
Naive
  • 372
  • 2
  • 5
  • 18
0

use subprocess to run other programs from Python.

Jayesh Bhoi
  • 20,158
  • 11
  • 56
  • 69