是否有任何方法來計算一個函數在Python中調用多少次? 我在GUI中使用checkbutton。我已經爲該checkbutton命令寫了一個函數,我需要根據checkbutton狀態執行一些操作,我的意思是根據是否打勾。我的checkbutton和按鈕的語法是這樣的要計數no。次函數被調用?
All = Checkbutton (text='All', command=Get_File_Name2,padx =48, justify = LEFT)
submit = Button (text='submit', command=execute_File,padx =48, justify = LEFT)
所以我thougt的計數沒有。命令函數被調用的次數,根據它的值我可以決定它是否被打勾。請幫助
檢查按鈕沒有屬性或方法來提供它的當前狀態? –
^你在用什麼框架,Tkinter? – 2012-11-22 12:27:29
[在另一個方法中計數python方法調用]可能的重複(http://stackoverflow.com/questions/1301735/counting-python-method-calls-within-another-method) –