I'm redirecting stderr to a file with
python foo.py 2> stderror.txt
Once the script is partway done, I want to move stderror.txt
with
subprocess.call(['cp', 'stderror.txt', 'destination.txt'])
My question - what if I redirected stderr to results/stderror.txt
? Is there a way to programmatically get the destination of a redirect from within the script?
(Note: I know that this isn't really the way to solve my problem. Just curious.)