Alright, I'm trying to make a small GUI application that'll allow me to run a .ck file (with ChucK) from a GUI, from a preset directory.
Okay, so I have:
from Tkinter import * class chuckrun: def __init__(self, master): ui = Frame(master) ui.pack() self.file = Entry(ui, text="Filename") self.file.pack(side=LEFT) self.play = Button(ui, text="Play", command=playCk) self.play.pack(side=RIGHT) def playCk(self): p = os.popen('chuck') # run chuck $HOME/Apps/Source/ChucK/Filename # (from the Entry field above) root = Tk() app = chuckrun(root) root.mainloop()
def playCk(self) part, I have no idea what to do. What I want it to do is to run the command
chuck $HOME/Apps/Source/ChucK/[I]filename[/I] where filename is the filename specified in the Entry field above (as stated in the comment).
But, what I really need it to do is store the text in the entry field into a variable (x), then call the shell command
chuck $HOME/Apps/Source/ChucK/x . But I have no idea how to use variables, say from Python to the shell and vice versa.
Can anyone help me?
Thank you in advance!