Python py_var0

你好
一件我不明白的事
我启动了一个程序.py,恢复树视图的选定行,
我将这些值​​赋给这两个字段,TT就会正确发生。

选择 | 换行 | 行号
  1. prog.py
  2.  
  3. def selection
  4.        curitem=tree.focus()
  5.        dict=tree.item(curitem)
  6.        chvalue1.set(dict["values"][1])
  7.        chvalue2.set(dict["values"][2])
  8.  

问题就在这里:
通过一个从按钮调用的函数从另一个p..py调用相同的脚本:

选择 | 换行 | 行号
  1. prog1.py (this is the prog that calls prog.py)
  2.  
  3. def list():
  4.      exec(open("./prog.py").read(), globals())
  5.  
  6.  
  7. chEntry1=entry(fen, textvariable=chvalue1)
  8. chEntry2=entry(fen, textvariable=chvalue2)
  9. the chvalue1 and chvalue2 do not take any value and my print displays py_var7

提前谢谢你

标签: python

添加新评论