text: Thanks for mainitaining this forum, it's been (and will continue to be) a great python tutor for me.
  I have a small class (only one function so far) of dialogs for opening the files and selecting starting directories that I need for my application. I am using the tkinter fieldialog library and python3.3 on fedora 20. The class works exactly as I want it to, except for one thing. I don't know how to make the main TK window invisable, and I don't know how to gracefully destroy it (main window) when when I finish with the dialog window.
  Here's the code:
  - Code: Select all
  import tkinter
  import tkinter.filedialog
  import time;
  class fileDialogs():
  def openLog():
  """Opens selected Logfile."""
  ticks = time.time()
  logFileName = ('log' + str( int(ticks) ) + '.log')
  file_opt = options = {}
  options['title'] = 'Open Log File'
  options['initialdir'] = '.'
  options['initialfile'] = (logFileName)
  options['defaultextension'] = '.log'
  options['filetypes'] = [('log files', '.log'),
  ('all files', '.*'),
  ('text files', '.txt')]
  return tkinter.filedialog.asksaveasfilename(**file_opt)
  logName = ''
  logName = fileDialogs.openLog()
  print( 'Logname: ', logName )
  As soon as I fix these two issues, I'll add other code that I require. I'd appreciate your thoughts on this. I'm thinking there must be some sort of 'not visible' attribute, and a destroy method as well.
  Thanks,
  Larz