i’m uninstall some packages in Linux via python os module my code like
def uninstallZdev():
print 'Uninstallation as a Super User'
system('apt-get remove xxx')
uninstallPackage()
but remove package ask like
After this operation, 2,621 kB disk space will be freed.
Do you want to continue [Y/n]?
how to give Y in program via python
Configure
apt-getnot to ask (see theapt-getman page:For tools that cannot be configured, use
pexpectto steer the process.pexpectlets you listen for output from a subprocess, and send input based on a simple API: