Skip to content

limafresh/CTkFileDialog

Repository files navigation

CTkFileDialog

Unofficial file dialog for CustomTkinter.

Screenshot

Screenshot

How to use?

Download and place the CTkFileDialog folder into your script folder.

Open file

dialog = CTkFileDialog()
if dialog.path:
    print(dialog.path)

Save file

dialog = CTkFileDialog(save=True)
if dialog.path:
    print(dialog.path)

Arguments

Argument Description
width dialog window width
height dialog window height
hidden_files False (by default) or True
initialdir initial dir
title dialog window title
save save=False if open file (by default), save=True if save file
save_extension Save extension, for example, save_extension=".txt"

CTkFileWidget (new!)

A widget that can be added to an existing window.

Screenshot

def my_command():
    print(filewidget.path)

filewidget = CTkFileWidget(root, command=my_command)
filewidget.pack(padx=10, pady=10)

Arguments

Argument Description
master master, required
command the command that will be executed when you click "OK"
All of CTkFileDialog except title

Projects using CTkFileDialog

  • Brushshe: fully functional painting app written in CustomTkinter