I am trying to open a new terminal through a python script and run a linux command in it using subprocess().
This is the code I used:
import subprocess
command="subprocess.run('ls')"
subprocess.Popen(['gnome-terminal', '--', 'bash', '-c', command], stderr=subprocess.STDOUT, stdout=subprocess.PIPE)
It launches a terminal but then closes immediately after, and I cannot find if the command got executed at all.