I'm running into a question, there is data file I need to process, let's name it Data.data
. I need to process this data file in two steps, each of them is in a separate python .py
file.
The first step (Let's name it first.py
) takes the Data.data
as input and output into a .txt
file named output1.txt
(output1.txt
is generated by first.py
); then the second step (Let's name it second.py
), takes the output1.txt
as input and print the results.
Both python file take inputs with sys.argv[1]
.
I'm trying to write a .sh
file to do the job listed above (Data.data
, first.py
and second.py
are in the same directory) --- first process Data.data
with first.py
, this should generate output1.txt
, then run second.py
with output1.txt
as input and print the result with python's own print
function.
Could anyone show me how to do this? I spent a lot of time trying to code this up and I'm really stucked. I can write a .sh
that run 2 .py
at the same time but not like this situation, please save me, thank you very much!