I am working with Python. Writing a script, I am attempting to use os.system() to open a new terminal, create new tabs and run different commands in each respective tab (which appear to run simultaneously).
I am familiar with gnome-terminal as it is what I have used in the past, however the system I am working with at the moment, a Raspberry Pi (Raspbian), uses lxterminal.
I have always used
os.system("gnome-terminal --tab -e 'command1' --tab -e 'command2' ")
with success, but I don't know how to reproduce these results with lxterminal. So, basically I'm asking if and how lxterminal can do this.
I can create the tabs, no problem, with
lxterminal --tabs=1,2,3
and
lxterminal --tabs=1,2,3 --command="command1"
does create the tabs and execute the first command in the first tab... but that's as close as I can get, and obviously that doesn't do the trick of multiple commands in tabs 2 and 3.
If the lxterminal man gives any clues I'm just missing them... I thought maybe the brackets under -t, --title, and --tabs section might point to details for those, so I tried something like
lxterminal --tabs=1[--command="command1"],2[--command="command2"]
But that only titled the tabs.... as expected.
All of my searches point me back to gnome-terminal but if there's a way to make lxterminal do this, I'd love to know.
I know this is so late and I'm not an expert just sharing, but I hope anyone who has a similar problem can be helped.
to do that you need to make a new bash file example.bash then insert command you want, like;
#!/bin/bash
lxterminal --command 'cd /Apath/Bpath/Cpath/ && sudo example.bash/py/sh/bash'
lxterminal --command 'cd /Dpath/Epath/Fpath/ && sudo example.bash/py/sh/bash'
lxterminal --command 'cd /Gpath/Hpath/Ipath/ && sudo example.bash/py/sh/bash'
it will open 3 of the script in the new terminal ༼ つ ◕_◕ ༽つ