I have this program in python that reverses a string. Keep in mind that it is only a example. I won't use it for any real world application
while True:
n = input("Coisa:")
if n == "ex":
break
n = n[::-1]
print("\n"+n)
print("stoped")
When I try passing an input through a batch file using this script:
echo 1234|myprogram.py
pause
It works in the first input, but than gives an End of file error, because it tries to receive an input but none is passed
Is there a way to pass the first input, than the next input will be done by the user using the keyboard?
I want to now a more general solution. There might way to do this by modifying the program, but it wouldn't work for other programming languages.