set_output(X) sets the current output to the stream represented by X.
X will be a term returned as the third argument of open, or the atom user_input, which specifies that output is to go to the computer display.
Examples
See Input and Output