看板 [ Python ]
討論串[問題] 傳遞參數問題
共 2 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者dritchie (Dennis MjY3OTk5)時間10年前 (2015/12/20 19:04), 編輯資訊
0
0
0
內容預覽:
from functools import partial. for i in range(1, 10):. btn[i]=Button(root,text='click',command=partial(a,i,i*2)). --. 發信站: 批踢踢實業坊(ptt.cc), 來自: 111.2

推噓1(1推 0噓 4→)留言5則,0人參與, 最新作者IAMPF (PF)時間10年前 (2015/12/20 12:25), 10年前編輯資訊
0
0
0
內容預覽:
各位大大們好. 最近在研究Tkinter寫視窗程式,遇到一個問題. 比如我今天創一個Button. def a():. print 'Hello'. b = Button(root, text='click', command=a). 問題就在這個command=a. 通常a這個function不能
(還有315個字)
首頁
上一頁
1
下一頁
尾頁