I'm a bit confused on how redirecting python output works.
For example, if I run my python code with any file, let's say "file.input," my code uses this file to do some calculations, but then I want my output to be sent to the screen, but also to a corresponding "file.output."
Example "calculations.input" contains the formula c= a+b, then in my code I say that a=1, b=2, but now I want this output printed to the screen, and into a corresponding "calculations.output" file. Any ideas, as I'm using Windows please?
So if the first time i run the code, i run it with example.input (and expect an example.out file to be automatically created), then the next time i run it with example2.input (with example2.output being created)