0

I am trying to open a new console terminal from Rust. With the help of documentation, I was capable of starting a terminal in the current terminal window, but not in another one.

For example, imagine I have one folder with two files main.py and bb.py and the following code does the thing I want

import os
os.system("start cmd /K python bb.py")

It opens a new terminal, and in this new terminal the command python bb.py is executed. How can I do this in Rust?

cafce25
  • 15,907
  • 4
  • 25
  • 31
  • 3
    Does this answer your question? [Execute a shell command](https://stackoverflow.com/questions/31666936/execute-a-shell-command) – life888888 Dec 27 '22 at 04:55
  • Looks like it doesn't work on Windows. I'm getting an error: thread 'main' panicked at 'Failed to execute command: Error { kind: NotFound, message: "program not found" }', src\main.rs:7:10 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace – fernetserret Dec 27 '22 at 17:49

0 Answers0