문제

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