1

An example is:

python script1.py arg1 arg2

python script2.py arg1

where arg1 is from the first python call

Greg
  • 168
  • 1
  • 3
  • 19
  • 1
    You can use `&&` to concatenate both commands https://stackoverflow.com/questions/5130847/running-multiple-commands-in-one-line-in-shell – F.Igor Sep 07 '18 at 03:11
  • 1
    What do you mean by `where arg1 is from the first python call`, the input for second call is come from output of first call? – atline Sep 07 '18 at 03:29

2 Answers2

1

How does script1 return its result? If it’s in stdout, try:

python script2.py $(python script1.py arg1 arg2)

$(…) runs the first script and takes the stdout output as the argument for the second script.

Gary Makin
  • 3,109
  • 1
  • 19
  • 27
0

It is a matter of taste, to use either $(...) or backticks, I like backticks more:

python script2.py `python script1.py arg1 arg2`
Ville Laitila
  • 1,187
  • 11
  • 18