Is there anything in python that can replicate the functionality of freopen() in C or C++? To be precise, I want to replicate the functionality of:
freopen(\
Try this:
import sys sys.stdin = open('input.txt', 'r') sys.stdout = open('output.txt', 'w')
Text files are self explanatory. You can now run this code on Sublime Text or any other text editor.