Jan-04-2018, 02:13 PM
Hi all, I am trying to get to grips with Python using Visual Studio 2017 on Windows 10 and have a problem that may be a bug in VS or my misunderstanding of an import concept.
If I use the following code (snippet) on the line "name =" I get the error that tkinter does not contain filedialog
However, if I add one extra line as follows it now works fine, but I cannot see how the 2nd line added can effect the "name = " line that failed the first test
Is this a problem with visual studio and Python or have a misunderstood the import directive
Thanks in advance
If I use the following code (snippet) on the line "name =" I get the error that tkinter does not contain filedialog
import tkinter as TK .... name = TK.filedialog.askopenfilename()
However, if I add one extra line as follows it now works fine, but I cannot see how the 2nd line added can effect the "name = " line that failed the first test
import tkinter as TK from tkinter.filedialog import askopenfilename .... name = TK.filedialog.askopenfilename()
Is this a problem with visual studio and Python or have a misunderstood the import directive
Thanks in advance