def SelectFolder(req = 'Please select a fgdb:'):
    """ Customizable folder selection dialogue, changes current directory to and returns mypath. """
    try:
        root = Tk.Tk(); root.withdraw(); mypath = tkFileDialog.askdirectory(initialdir="C:\\", title=req); root.destroy()
        os.chdir(mypath)
        return mypath
    except:
        print "Error in folder selection:", sys.exc_info()[1]; time.sleep(5);  sys.exit()
 Customizable folder selection dialogue, changes current directory to and returns mypath. 
recipes/Python/578654_ListPopulatedFeaturesTablespy/recipe-578654.py