How can i hide the process of installing java (apt-get openjdk-6-jre) when it's runned in python? So i can replace it with "Installing Java..." till it's ready.
Thanks in advance.
proc = subprocess.Popen('apt-get install openjdk-6-jre', stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
output, errors = proc.communicate()
return_Value = proc.returncode
This puts the program output into a string in Python, where you should probably check it for errors. See subprocess docs. (Unlike the redirect to /dev/null, this is cross-platform.)
os.devnull is cross-platform.
subprocessor something like that to spawn a new process? If yes, just execute<command_here> >/dev/null 2>&1and print whatever you want.