Answer the question
In order to leave comments, you need to log in
Why doesn't the tkFileDialog module work?
So I decided to write a desktop program in Python 3.2 (do not ask what this module is for) and wrote the following code in the import:
from tkinter import *
import tkFileDialog
def LoadFile(ev):
fn = tkFileDialog.Open(root, filetypes=[('*.txt files', '.txt')]).show()
if fn == '':
return
textbox.delete('1.0', 'end')
textbox.insert('1.0', open(fn, 'rt').read())
Answer the question
In order to leave comments, you need to log in
correction of the first part:
from tkinter import *
from tkinter.filedialog import and what you need in this library separated by commas (or *)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question