Quick and dirty dialogs?

A

andy

What's the easiest way for a script to throw up simple dialogs such as
file select and alerts?

I thought there was something in the standard library that didn't need
TK and was cross-platform but I can't seem to get my Google-fu working
well enough to find it.
 
R

Robert D. Young

I use quick-and-dirty code like this:

############################################################################
# Get source directory and text file
############################################################################
Root = Tkinter.Tk()
Root.title(programname)
srcdir = tkFileDialog.askdirectory(title='Choose the source directory',
initialdir='C:\\')
srcfile = tkFileDialog.askopenfilename(title='Choose the text file',
initialdir=srcdir)
Root.destroy()



- Robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top