0

I have a text file example contents line by line:

python example.py (do some stuff 1)
python example.py (do some stuff 2)
python example.py (do some stuff 3)
python example.py (do some stuff nth)

Is there a simple script/way to run all those commands line by line from the text file in python?

Thanks in advance

X_strong
  • 17
  • 4
  • Can you give an example of "do some stuff"? Are these args you're passing to the top-level script, or are you talking about calling functions that are defined in that module? – Samwise Sep 07 '21 at 19:29
  • Running it a shell loop would be even easier. That'll depend on your shell. – 9769953 Sep 07 '21 at 19:29
  • can you use bash? `cat $file; while read line; do $line; done` – ichramm Sep 07 '21 at 19:30
  • python seedrecover.py --wallet-type bip39 --addrs bc1qv87qf7prhjf2ld8vgm7l0mj59jggm6ae5jdkx2 --mnemonic "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect" --addr-limit 5 – X_strong Sep 07 '21 at 19:30
  • 1
    Perhaps this can help you with your problem: https://stackoverflow.com/a/36836686/15794497 – realemptybox Sep 07 '21 at 19:35
  • thank you so much for all feedback, let me study all examples provided regards – X_strong Sep 07 '21 at 19:37
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Sep 13 '21 at 01:52

0 Answers0