Run multiple commands in single cmd terminal?
Copy link to clipboard
Copied
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?
Explore related tutorials & articles
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
The shell script also does not execute multiple commands. Maybe it's the first command "wsl" that's the issue.

