- 论坛徽章:
- 1
|
- win = tk.Tk()
- win.geometry('300x200')
- tk.Label(win, text='保存目录', height=1, width=10).grid(row=1, column=0)
- txt_path = tk.Text(win, height=1, width=30, padx=10, pady=5)
- txt_path.grid(row=1, column=1)
- def down_video(sv):
- print(sv)
- def get_addr():
- t = txt_path.get(0.0, tk.END)
- print(t)
- tk.Button(win, text='down', width=10, height=1, command=lambda: down_video(sv=get_addr)).grid(row=2, column=0)
- tk.Button(win, text='test', command=get_addr).grid(row=3, column=0)
- win.mainloop()
复制代码
点test按钮可以print出tk.text输入的内容。
但是按down按钮,就显示<function get_addr at 0x000000000A81FE18>
是为什么???
|
|