我正在学习使用tkinter,但我不知道如何打开文本文件并保存数据,以便在其他计算中使用这些数据。在我下面的代码中,创建了一个按钮,当按下该按钮时,它会请求并打开一个文件。然后,它在控制台中打印文件的内容。例如,如果文件包含单个数字,例如100,我不知道如何将该数字保存为变量,如“a”。from tkinter.filedialog import askopenfile
root.geometry('200x100')# This function willused t
这是我正在使用的代码: from docx import Documentfrom tkinter import * # Then some code which updates the doc according to the tkinter Entry inputnaamhuurder.get())) # This should convert it to a pdf with the same name in