application install script on Ubuntu 16.04
実行するときはsudoで実行する。
#!/usr/bin/python import commands def command(cmd): check = commands.getoutput(cmd) if( len(check) ): print check ### if __name__=='__main__': lis1 = ["update", "upgrade"] lis2 = ["emacs24", "samba", "openssh-server"] # lis3 = ["global", "quilt", "gnuplot-x11"] for x in lis1: command( "apt-get -y " + x ) for x in lis2: command( "apt-get -y install " + x ) """ for x in lis3: command( "apt-get -y install " + x ) """