Results 1 to 6 of 6

Thread: Folder children

  1. #1
    Join Date
    Jul 2005
    Location
    London,England
    Beans
    1,022
    Distro
    Ubuntu Karmic Koala (testing)

    Folder children

    , i was wondering , how do i use a gtk dialog via pyGTK to let me select a folder and it return all the files in that folder?
    ive got some code that works to select multiple files but i cant seem to do the above.

    just ask for any more details
    Jeremy Clarkson - "A Dazzling Hero of Political Incorrectness"
    My LastFM profile
    want to Give each GTK program its own theme? well look Here

  2. #2
    Join Date
    Nov 2004
    Location
    Clemson, SC
    Beans
    271

    Re: Folder children

    If you setup your FileChooserDialog to select a folder, you can use glob.glob to list the the contents of the directory returned by get_filename().

  3. #3
    Join Date
    Jul 2005
    Location
    London,England
    Beans
    1,022
    Distro
    Ubuntu Karmic Koala (testing)

    Re: Folder children

    thx, but thats what i dont know how to do, set my filechooserdialog to select a folder.
    Jeremy Clarkson - "A Dazzling Hero of Political Incorrectness"
    My LastFM profile
    want to Give each GTK program its own theme? well look Here

  4. #4
    Join Date
    Nov 2004
    Location
    Clemson, SC
    Beans
    271

    Re: Folder children

    you need to set the action to gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER

  5. #5
    Join Date
    Jul 2005
    Location
    London,England
    Beans
    1,022
    Distro
    Ubuntu Karmic Koala (testing)

    Re: Folder children

    thanks duff worked like a charm,

    is there a way to check whether the item returned by glob in a folder is another folder or or a file?

    last question, i promise
    Last edited by Hairy_Palms; January 4th, 2007 at 01:46 AM.
    Jeremy Clarkson - "A Dazzling Hero of Political Incorrectness"
    My LastFM profile
    want to Give each GTK program its own theme? well look Here

  6. #6
    Join Date
    Nov 2004
    Location
    Clemson, SC
    Beans
    271

    Re: Folder children

    You could get that information from os.stat, but if you're needing to dive into nested directories, try os.walk instead of glob.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •