I\'m participating in online judge contests and I want to test my code with a .in file full of testcases to time my algorithm. How can I get my script to take input from this .i
You can do this in a separate file.
testmyscript.py
import sys someFile= open( "somefile.in", "r" ) sys.stdin= someFile execfile( "yourscript.py" )