Is there anything in python that can replicate the functionality of freopen() in C or C++? what should i do if I want to replicate the functionality of:
freopen("input.txt","r",stdin);
and
freopen("output.txt","w",stdout);
And also use the same (standard) functions for console I/O for file I/O. how can i do it?