我在選擇模式是「擴展」時檢索列表框選擇有問題。事實上,我的列表框項目是腳本,我必須能夠選擇多個腳本,我可以將這些腳本作爲參數傳遞給我的解釋器,他們的角色是依次運行這些腳本並給出結果。問題是,我所能做的一切僅在使用這種方法選擇一個腳本:檢索選擇列表框或選擇模式=擴展在tkinter python
def get_list(*event):
que2.put_nowait(script)
seltext = liste.get(index)
script=seltext
que2.put_nowait(script)
def get_port(event)
index = liste1.curselection()[0]
seltext = liste1.get(index)
nb_port=seltext[1]
que1.put_nowait(nb_port)
def call_interpreter1():
b=que2.get(block=True)
a=que1.get(block=True)
print "prameters are :" ,a ,b ,"\r\n"
c='python C:\\workspace\\Project_Interpreter\\ValidationTool-v1.0.py -s %s %s'%(b,a)
ps=sp.Popen(['cmd','/K',c],creationflags=0,shell=False,stdout=PIPE,stderr=sp.STDOUT,stdin=PIPE)
與谷歌翻譯的翻譯
英文請。 –
hello, 我正在使用python tkinter,並且在selectmode擴展時遇到問題。實際上,我的列表包含腳本,當我選擇一個或多個腳本時,它將把我的選擇傳遞給解釋器,解釋器將一個接一個地運行這些腳本並返回運行結果。 所以我的問題是,我做了所有這一切,但只有一個選擇,我無法通過擴展選擇使用此方法: index = liste.curselection()[0] seltext = liste.get(index) script = seltext que2.put_nowait(script) – Ibrahim
您沒有足夠的代碼來幫助我們。例如,你如何計算上述代碼片段中的'index'? –