Domanda

Is it possible to use os.system to install a program on apt-get. Here's what I've tried so far:

if comm == "install":
  os.system("gnome-terminal -e sudo apt-get install"+args)

(args being the argument supplied to the command)

È stato utile?

Soluzione

It is possible, but I'd personally avoid using os.system() (or preferred subprocess module calls) for python apt interface: homepage

It gives you much more flexibility than plain os.system() (e.g. installation progress reporting etc.)

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top