#1
  1. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2004
    Location
    There where the rabbits jump
    Posts
    556
    Rep Power
    11

    Tkinter Default Saving/Opening Windows?


    Hi

    This is a very easy question:

    In Tkinter is there a window which acts like a saving or loading window which is predefined meaning which I can use like a toplevel widget or something like that. and if there is how do I use it?
    Those people who think they know everything are a great annoyance to those of us who do.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Posts
    394
    Rep Power
    51
    Hi!

    Do you mean something like the tkFileDialogs?
    Code:
    from Tkinter import *
    import tkFileDialog
    
    def load():
        filename = tkFileDialog.askopenfilename()
        print filename
    
    def save():
        filename = tkFileDialog.asksaveasfilename()
        print filename
    
    root = Tk()
    Button(text="Load", command=load).pack()
    Button(text="Save", command=save).pack()
    
    root.mainloop()
    Regards, mawe
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2004
    Location
    There where the rabbits jump
    Posts
    556
    Rep Power
    11
    thanks they have such wierd names:P
    Those people who think they know everything are a great annoyance to those of us who do.

IMN logo majestic logo threadwatch logo seochat tools logo