title: How do I save print statements when running a program in SLURM?
body: <p>I am running a Python code that contains print statements via SLURM.  Normally when I run the Python code directly via "python program.py" the print statements appear in the terminal.  When I run my program via SLURM, as expected the print statements do not appear in the terminal.  How can I save the print statements to a file so I can check them as the program is running?  Below is my submission script that I submit via "sbatch submit.sh".  Notice that I've already tried two methods to write the output either to test1.out or test2.out.  Please let me know where I'm going wrong!</p>
  
  <pre><code>#!/bin/bash
  
  #SBATCH -J mysubmission
  #SBATCH -p New
  #SBATCH -n 1
  #SBATCH -t 23:59:00
  #SBATCH -o test1.out
  
  module load gnu python
  
  python program.py &gt; test2.out
  </code></pre>