Jul-26-2018, 11:51 PM
Hello All,
I am new to Python and have found my first head scratcher. I expect to find a have stumbled into some rookie mistake.
The below code creates a texbox that I can enter text in, highlight, copy ...
if I un-comment the file dialog portion of code the text box will no longer accept keyboard entry.
I have replicated this in 3.7 using Idle and 3.6 using Thonny.
What am I missing, or doing wrong.
I am new to Python and have found my first head scratcher. I expect to find a have stumbled into some rookie mistake.
The below code creates a texbox that I can enter text in, highlight, copy ...
if I un-comment the file dialog portion of code the text box will no longer accept keyboard entry.
I have replicated this in 3.7 using Idle and 3.6 using Thonny.
What am I missing, or doing wrong.
from tkinter import filedialog from tkinter import * #build form frmMain = Tk() Tb1 = Text(frmMain,bd=10,height=12) Tb1.grid(row=0,column=0,padx=10,pady=10,sticky=W+E) ##frmMain.filename = filedialog.askopenfilename(initialdir = "/",title = "Select file",filetypes = (("CSV files","*.csv"),("all files","*.*"))) ##NameOfFile = frmMain.filename ##f = open(NameOfFile,"r") ##f.close frmMain.mainloop()