Skip to main content
TheAzzam
Inspiring
September 13, 2022
Question

Run multiple commands in single cmd terminal?

  • September 13, 2022
  • 1 reply
  • 632 views

Hello. I know that by using app.system(), you can run a command in a terminal, but that terminal closes after the command executes. How can I run multiple commands in the same terminal?

This topic has been closed for replies.

1 reply

Mylenium
Legend
September 13, 2022

You simply string together the relevant commands when you call the command window. Generally, though, it's better to combine complex system commands in shell scripts/ batch files.

 

Mylenium

TheAzzam
TheAzzamAuthor
Inspiring
September 13, 2022

For example, I have this string of commands: wsl & cd /mnt/c/Users/DELL/Documents/Quixel/multi_grabcut & python main.py --image data/a.png --scribbles data/s.png --output data/output.png --resolve_type pixel

 

However, running them using app.system() in a single line does not work.

Legend
September 13, 2022

It should work in a single line with a semi-colon between the commands, I'd have thought. If not, just write a shell script.