I want to run multi command lines by clicking different buttons using python GUI ?
for example I have button1 and button2 when I click button1 a command line will be excuted and when I press button2 another shell should be opened and new command line will be runned withour stopping the firat one.
I read about it but I didn't find the suitable code for that
What I wrote is the following:
class Application(Frame):
"""A GUI """
def __init__(self,master):
Frame.__init__(self,master)
self.grid()
self.create_widgets()
def create_widgets(self):
#create first button
self.button = Button(self, text="roscore", command=self.roscore)
self.button.grid()
#create first button 1
self.button1 = Button(self, text="rqt plot", command=self.open_rqt)
self.button1.grid()
def open_rqt(self):
call(["rosrun", "rqt_plot", "rqt_plot"])
def roscore(self):
call(["roscore"])
root = Tk()
root.title("GUI")
root.geometry("1000x1000")
app = Application(root)
root.mainloop()