[python] How can I get terminal output in python?