Using tkinter in DrawBot



  • Hi,

    I would like to ask users to select a folder and get his path. Here with my code, a window opens to choose the file but nothing happen after. Like if the script stop after the 3rd line.

    from tkinter import Tk
    from tkinter.filedialog import askdirectory
    path = askdirectory(title='Select Folder') # shows dialog box and return the path
    print(path)  
    

    No error message appears.
    I put the complete tkinter module in the folder which contain the script.


  • admin

    never used tkinter... DrawBot itself is made with `vanilla a pythonic wrapper around pyobjc.

    vanilla has all the dialogs you'll need!

    import vanilla
    
    result = vanilla.dialogs.getFileOrFolder()
    print(result)
    
    import vanilla
    help(vanilla.dialogs)
    


  • I didn't know that option, thanks a lot frederik !


Log in to reply