Redirect output of a Python file from batch

68 views Asked by At

I have the following command in batch and I want to redirect the output in console and also into a file at the same time:

python GeneAll.py --var VARIANT_%VAR_ASD%

If redirecting this Python file output in file and console is imposible, can you give me an idea how can I redirect only stderr in console and file and the stdout only in the file? Thanks!

1

There are 1 answers

0
Edward Rosinzonsky On
python GeneAll.py --var VARIANT_%VAR_ASD% | tee -a my_log.txt

on linux

or

python GeneAll.py --var VARIANT_%VAR_ASD% | tee -filepath C:\my_log.txt

on windows with powershell