title: redirecting the output of a python command to a txt file working in cmd but not in .bat file, how to solve?
body: <p>well I'm trying to make a logger for my python script using a runner in a '.bat' format, that executes the script and saves an output file; without me having to do it manually.</p>
  
  <p>when I tried to run my python script, script.py, and pass 20 as an argument for the script as well as redirecting the output to a log_file.txt, using windows command prompt, it worked just fine, and the log file was created.
  ~the cmd command: </p>
  
  <pre><code>python script.py 20 &gt;&gt; log_file.txt
  </code></pre>
  
  <p>But when I tried to run the same code using the runner ".bat" file it didn't work.</p>
  
  <p>~The codes I've written inside the "runner.bat" is as follows</p>
  
  <pre><code>python script.py 20 &gt;&gt; log_file.txt
  pause
  </code></pre>
  
  <p>~but the execution command is done by the bat file was-as seen from the screen-:</p>
  
  <pre><code>C:\Users\dahom\Desktop\folder&gt;python script.py  1&gt;&gt;log_file.txt
  </code></pre>
  
  <p>I expected the ".bat" file to behave the same save the log_file as the cmd terminal.
  But when I ran the bat file it didn't redirect the output to the log_file.txt
  But it seems to be running the script, without but one indication that it takes some time for the script running.
  note: both the batch file and the script are in the same folder/dir/path.</p>
  
  <p><a href="https://imgur.com/dqKzak4" rel="nofollow noreferrer">HERE</a> is an image showing everything.</p>