-1
いくつかのパッケージをインストールするために、次のコードを書いています。私はスクリプトが出力にインストールプロセスメッセージを表示しないようにします。パッケージのインストールが完了したら、出力にプロンプトが表示されます。このタスクを実行するには、次のコードをどのように書き直すことができますか。固定UbuntuパッケージのインストールPythonコード
def package_installation(self):
self.apt = "apt install -y "
self.packages = "python-pip python-sqlalchemy mongodb python-bson python-dpkt python-jinja2 python-magic python-gridfs python-libvirt python-bottle python-pefile python-chardet git build-essential autoconf automake libtool dh-autoreconf libcurl4-gnutls-dev libmagic-dev python-dev tcpdump libcap2-bin virtualbox dkms python-pyrex"
self.color.print_green("[+] Phase 2 : Installation of the ubuntu packages is starting:")
for self.items in self.packages.split():
self.command = str(self.apt) + str(self.items)
subprocess.run(self.command.split())
self.color.print_blue("\t[+] Package [{}] Installed".format(str(self.items)))
self.color.print_green("[+] Phase 2 Accomplished. ")