Input "print" behavior not redirected?

I cannot remember how it was before psi4 was made a python module, but right now “print” prints
to stdout (I think). I was confused trying to find my table in the redirected output where the calculation is.

I am talking about something like this

I personally would prefer having all output collected in the usual output.

My workaround is abusing the bash:
psi4 table.out &>>table.out

Is this behavior intended or an overlooked consequence of the changes?

My history shows print no longer being directed to the output file as happening earlier than the inversion, but certainly around that time, we became more receptive to leaving legitimate python alone, instead of intercepting it and redirecting to the output file. I think previously print went to the output file and print_stdout went to ~screen. Now, print does go to screen, as you noted, but you can send most stuff to the output file via print_out. The below collects everything to output.

molecule h2o {
  H 1 R
  H 1 R 2 A


table=Table(rows=["R","A"], cols=["E(SCF)","E(SCS)","E(DFMP2)"])

set basis cc-pvdz

print_out("cat in the hat")  # plain string

for R in Rvals:
    h2o.R = R
    for A in Avals:
        h2o.A = A
        escf = get_variable('SCF TOTAL ENERGY')
        edfmp2 = get_variable('MP2 TOTAL ENERGY')
        escsmp2 = get_variable('SCS-MP2 TOTAL ENERGY')
        table[R][A] = [escf, escsmp2, edfmp2]

print_out(str(table))  # object
#print_out(str(relative).decode())  # alt. object if it starts complaining about unicode

If you print a psi4.Matrix or Molecule, that’s always going to go to the output file. It’s true that the current printing scheme isn’t throughly consistent, but it’ll probably stay as is until we need to revise for, say, Jupyter notebooks.

Thank you @loriab. Using print_out is a good solution.