您好,我想根据文件中的文本配置一个标签,但没有任何反应。为什么?下面是我的代码:
#function operated by a button
def add(ligne,labelP):
if "Diffusion" in ligne:
labelP.config(text="DiffOk")
#in the Frame "fr"
input = open('precipitation.txt','r+')
for ligne in input:
ligne=ligne.split()
labelP=Label(fr,text=ligne)
labelP.grid(sticky=N+E)
>>precipitation.txt :
Diffusion
Coeff_diffusion-atom1...(cm2/s)
Coeff_diffusion-atom2...(cm2/s)
Coeff_diffusion-atom3...(cm2/s)
...谢谢
发布于 2018-11-28 09:01:31
split返回一个列表,这可能是问题所在,你不需要拆分ligne
https://stackoverflow.com/questions/53510419
复制相似问题