To do this, you have to create a file that stores the input you want.
!echo your_input > /kaggle/input.txt
Note that your working directory might be read-only, so you might have to write to the kaggle directory instead. Next, run your command, giving the file as input
!python do_stuff.py < /kaggle/input.txt