def pip_command_output(pip_args):
import sys<EOL>import pip<EOL>from io import StringIO<EOL>old_stdout = sys.stdout<EOL>sys.stdout = mystdout = StringIO()<EOL>pip.main(pip_args)<EOL>output = mystdout.getvalue()<EOL>mystdout.truncate(<NUM_LIT:0>)<EOL>sys.stdout = old_stdout<EOL>return output<EOL>
Get output (as a string) from pip command
:param pip_args: list o pip switches to pass
:return: string with results