I am trying to run a python script on ubuntu18, which simply will open a new terminal/tab,navigate to a specific folder and then execute a command. But this simple task is looking very daunting due to my lack of knowledge. Expected:
In the python script $cd /home/metabase $java -jar metabase.jar My code:
try1: cmd = "gnome-terminal --tab 'cd /home/metabase/java -jar metabase.jar; read'" os.system(cmd) New tab opens but nothing happens try2: subprocess.call(['cd /home/metabase/', 'java -jar metabase.jar']) Error:No such file or directory I tried many other combinations. But results in either new tab not opening or new tab opens but in the same directory and does nothing. I did some reading on the problem. It seems like i am creating these subprocess and therefore when i do the CD, it does nothing. Anyways,i looked into many similar stackoverflow threads but i am still lost. Any direction would be appreciated. Thank you