Fange gerade mit wxpython an und hab ein prob.
Ich schreibe nen pfad in das entry feld und möchte wenn ich start drücke, das er mir den pfad printet.
Code: Alles auswählen
class MyFrame(wx.Frame):
def __init__(self, parent, id, title):
wx.Frame.__init__(self, parent, id, title, size=(250, 270), style = wx.DEFAULT_FRAME_STYLE)
wx.StaticText(self, -1, 'Programmpfad', (10, 20))
self.folder = wx.TextCtrl(self, -1, '', (110, 15), (120, -1))
start = wx.Button(self, 1, 'start', (10, 160))
self.Bind(wx.EVT_BUTTON, self.befehl1, id=1)
def befehl1():
cmd = self.folder.GetValue()
print cmd
#subprocess.Popen(cmd)
class MyApp(wx.App):
def OnInit(self):
frame = MyFrame(None, -1, 'test')
frame.Show(True)
return True
app = MyApp(0)
app.MainLoop()
thx