My Python program requests some user input:
n = int(input())
for i in range(n):
s = input()
# ...
For debugging purposes, I would like to create a test input.txt file like this:
3
string1
string2
string3
so that I need not to manually enter data from the keyboard every time I launch it for debug.
Is there any way to get input() from text file, not from keyboard (without changing program code).
I am using Wing Personal as a dev tool.
Update
I know for sure, that there exist bots which are able to test python programs passing various inputs and comparing output with known answers. I guess these bots do not hit the keyboard with iron fingers. Maybe they use command-line tools to pass input.txt to the Python so that it reads input() from that file, not from keyboard. I would like to learn how to do it.