2017-04-12 4 views
0

응용 프로그램이 시작될 때 실행하고 싶은 기능이 load_words입니다.On Load 이벤트는 어떻게 처리합니까?

private void Form1_Load(object sender, EventArgs e) 
{ 
    LoadWords() 
} 

은 어떻게 파이썬에서이 작업을 수행 할 수 있습니다

C#에서

, 나는 다음과 같은 방법을 만들까요?

답변

0
from tkinter import * 

class Application(Frame): 

    def __init__(self, parent): 
     self.parent = parent 
     ### put HERE the "onLoad()" code ### 
     Frame.__init__(self, parent) 
    # self.create_widgets() 

... 

def main(): 
    root = Tk() 
    root.geometry('600x900-0+0') # 120 * 50 ppixels in top right corner of desktop 
    app = Application(root) 
    app.master.title('Sample application') 

    app.mainloop() 

if __name__ == '__main__': 

    main() 

는 Tkinter의 이벤트에 대한 자세한에 대해서도 here 참조하십시오.

해피 코딩 :). 그리고 tkinter를 사용하여 실망하지 마십시오. 예를 들어 파이썬에서 사용할 수있는 다른 많은 GUI 옵션이 있습니다. wxPython을 사용하면 C# 프로그래머가 더 쉽게 사용할 수 있습니다.

+0

알았습니다! @Claudio –