python:关于tk文件浏览与选取后对文件进行读写操作

s_file = tk.StringVar()
s_file.get()
def src_file():
s_file.set(askopenfilename())
src = tk.Button(window,text='SRC-File',font=('Aprial',12),width=10,height=1,command=src_file)
src.place(x=60,y=100)
src_entry = tk.Entry(window, show=None, font=('Arial', 12), textvariable = s_file)

so = open(s_file,'r')

还要一个类似的文件夹路径的选取和遍历操作一样的问题

不知道你这个问题是否已经解决, 如果还没有解决的话:

如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 以帮助更多的人 ^-^