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)

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top