Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use tkinter filedialog without a window

Tags:

python

tkinter

I would like to use the dialog boxes and message boxes without opening a tkinter window.

Can someone teach me how to disable the window, or how to recreate the window, or show me a different solution which allows me to do such things.

The messageboxes are the same all around, the one I want to try to take advantage of the most is filedialog.askopenfile, filedialog.askdirectory, filedialog.asksaveasfilename.

like image 805
Taha Abbasi Hashemi Avatar asked Jun 06 '15 03:06

Taha Abbasi Hashemi


1 Answers

Something like this?

from Tkinter import *
import tkFileDialog
import tkMessageBox

Tk().withdraw()
tkFileDialog.askopenfilename()
tkMessageBox.showerror("message", "words")
like image 138
maccartm Avatar answered Sep 24 '22 03:09

maccartm