EOF means that there is no more input. And it is true, the only line is consumed by -i
option:
$ echo "f()" | python -i -c "def f(): print('x'); input('y\n')"
>>> x
y
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 1, in f
EOFError: EOF when reading a line
>>>
Provide more input:
$ printf "f()\n'z'" | python -i -c "def f(): print('x'); print(input('y\n')*3)"
>>> x
y
zzz
>>>
As you said: it is "canonically bad" to specify a function to run in such manner. If you don't know in advance, what function you want to run then as an alternative, you could run it as:
$ python -c "from a06q1 import password_score as f; f()" < input_file.txt