Class A(): #class关键字首字母要小写
def GetEntryValues(): #类中的方法要添加self作为参数,或者使用staticmethod声明成静态函数
InputValue = InputPath.get()
print InputValue
return InputValue
def OpenInputValue(): #类中的方法要添加self作为参数
print "sdsdsd"
GetEntryValues() #调用类中方法的时候,如果是实例方法,需要使用self调用,如果是静态方法,需要类名调用
mainFrame = Tk()
frame1 = Frame(mainFrame)
frame1.pack()
InputPath = Entry(frame1)
InputPath.pack(side=LEFT)
GoButton = Button(frame1, text='open', command=OpenInputValue) #OpenInputValue是类中的方法,需要使用实例或者类名调用
GoButton.pack(side=LEFT)
mainFrame.mainloop()
我觉得你还是应该把python基础好好学习一下。推荐看下python核心编程。
如果解决了您的问题请采纳!
如果未解决请继续追问