#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Location
    INDIA
    Posts
    31
    Rep Power
    11

    TkInter folder browser and folder creator


    I think that everybody will be having idea about Folder browser and folder creator (mkdir) dialog box in window.

    Does any body have any idea that how to get this done using Tkinter?
    A dialog box which can display list of folder in their tree heirarchy and then can all creating folder in selected folder location.

    Thanks in advance

    Sandeep
  2. #2
  3. 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
    you have to program it

    you'll use text widget to program it and then you do mkdir from os to make them or remove them or something...
    Those people who think they know everything are a great annoyance to those of us who do.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Posts
    461
    Rep Power
    25
    you can use the os module to gather all the information about the directorys and modify them as well. There is a good resource for the os module on pythons web site (http://docs.python.org/lib/module-os.html) I recommend that you look into the Files and Directorys part of the referance (http://docs.python.org/lib/os-file-dir.html)

    Sorry, but no one is going to code something like that for you, since it is kinda lengthy. If you are looking for a build in weget that does this all for you in tkinter then you looking for something that isn't there. You will have to make it yourself. It shouldn't be to hard, You can probably go to the aspn cookbook on python and find half the code that you need to do this. Good luck!
  6. #4
  7. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2005
    Posts
    611
    Rep Power
    65

    Smile


    With Tkinter it is simple, run this code:
    Code:
    import tkFileDialog
    
    fname = tkFileDialog.askopenfilename()
    print fname
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Posts
    394
    Rep Power
    51
    Hi!

    Originally Posted by Dietrich
    With Tkinter it is simple, run this code:
    Well, thats nice to open a file, but that's not what d0153030 wants.
    As I understood him, he wants a tree-widget to show the directory-structure, and he wants to be able to create directories.
    Tkinter doesn't have a tree-widget, but here is a nice one to download

    Regards, mawe
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Location
    INDIA
    Posts
    31
    Rep Power
    11
    Thanks for all of your comments.

    I will try to code stuff by using Entry widget and tree widget as per last post.

    I will try to use the OS commands to browse for the \directory structure.

    thanks a lot

IMN logo majestic logo threadwatch logo seochat tools logo