I have a python script I would like to run from a bash script in this way:
#!/bin/bash
python -c "$(< input_file)" &> output_file
In the python script I have some different methods, so the input file contains things like:
from script import *; method_1(); method_2();
The problem is, in both of the methods, they have an input() method that requires user input (this can't be changed).
So how can I pass an argument in the input_file (some kind of newline argument) so that it is passed on to the input() method within method_1() or method_2()?
-care interpreted as arguments to pass to the python code (i.e. whatever code is in yourinput_file). So you could make the code in yourinput_fileread arguments from the command line and then send it whatever you like before the&> output_filepart.