Reputation: 61
I am running .py script with arguments, but the code asks for input and I can not enter anything as seen in the picture.
Upvotes: 6
Views: 10182
Reputation: 38694
Updated: Colab now supports input prompts. Try running things again, and you should see a prompt like so:
Upvotes: 3
Reputation: 7286
If you know beforehand what inputs you want to enter then you can use:
! printf 'y\ny\ny\n' | python run.py --task 1 --gpu -1 --data "data/"
In above case, if terminal prompts for an input three times, it will enter first y then y then y. \n
is just for newline.
e.g-
If you need to enter only two input, say q
followed by d
then it should look like:
! printf 'q\nd\n' | python run.py --task 1 --gpu -1 --data "data/"
Upvotes: 1