top of page

Dialogs (PE.dialogs)

PE.dialogs.ask_open_file(title: str, file_types=[('all files', '*')], initial_dir=None)

This is a documented version of tkinter.filedialog.askopenfilename()

function actions:

makes filedialog.askopenfilename() function and returns the output. open the file browser and asks for select a file from the disk.

​

parameters:

title - the file browser title (str)

file_types - what kind of file types can the user see (list of tuples of strings -> list[tuple[str]] -> [("",),])

initial_dir - the path that will be selected when the file browser is opened (str)

​

returns:

the output of filedialog.askopenfilename, selected file path (str)

​

​

PE.dialogs.ask_open_files(title: str, file_types=[('all files', '*')], initial_dir=None)

This is a documented version of tkinter.filedialog.askopenfilenames()

function actions:

makes filedialog.askopenfilenames() function and returns the output. open the file browser and asks for select several files from the disk.

​

parameters:

title - the file browser title (str)

file_types - what kind of file types can the user see (list of tuples of strings -> list[tuple[str]] -> [("",),])

initial_dir - the path that will be selected when the file browser is opened (str)

​

returns:

the output of filedialog.askopenfilenames, selected files paths (tuple of strings -> tuple[str] -> ("",))

PE.dialogs.ask_open_folder(title: str,  initial_dir=None)

This is a documented version of tkinter.filedialog.askdirectory()

function actions:

makes filedialog.askdirectory() function and returns the output. open the file browser and asks for select a folder from the disk.

​

parameters:

title - the file browser title (str)

initial_dir - the path that will be selected when the file browser is opened (str)

​

returns:

the output of filedialog.askopenfilenames, selected folder path (str)

PE.dialogs.show_error(title: str,  message: str)

This is a documented version of tkinter.messagebox.showerror()

​

function actions:

makes tkinter.messagebox.showerror() function. show a system error window, including the os's error icon, and the os's error sound.

​

parameters:

title - the system error window title (str)

message - the text inside the system error window (str)

PE.dialogs.show_info(title: str, message: str)

This is a documented version of tkinter.messagebox.showinfo()

​

function actions:

makes tkinter.messagebox.showinfo() function. show a system info window, including the os's info icon, and the os's info sound.

​

parameters:

title - the system info window title (str)

message - the text inside the system info window (str)

PE.dialogs.show_warning(title: str, message: str)

This is a documented version of tkinter.messagebox.showwarning()

​

function actions:

makes tkinter.messagebox.showwarning() function. show a system warning window, including the os's warn icon, and the os's warning sound.

​

parameters:

title - the system warning window title (str)

message - the text inside the system warning window (str)

PE.dialogs.ask_yes_no(title: str, message: str, icon='question')

This is a documented version of tkinter.messagebox.askyesno()

​

function actions:

makes tkinter.messagebox.askyesno() function. show a system question window.

​

parameters:

title - the window title (str)

message - the question (str)

icon - the tkinter system icon id of the icon that you want to show in the window (str)

​

returns:

user choice (yes-True, no-False) (bool)

PE.dialogs.ask_ok_cancel(title: str, message: str, icon='question')

This is a documented version of tkinter.messagebox.askokcancel()

​

function actions:

makes tkinter.messagebox.askokcancel() function. show a system input window.

​

parameters:

title - the window title (str)

message - the question (str)

icon - the tkinter system icon id of the icon that you want to show in the window (str)

​

returns:

user choice (ok-True, cancel-False) (bool)

PE.dialogs.ask_retry_cancel(title: str, message: str, icon='error')

This is a documented version of tkinter.messagebox.askretrycancel()

​

function actions:

makes tkinter.messagebox.askretrycancel() function. show a system input window.

​

parameters:

title - the window title (str)

message - the question (str)

icon - the tkinter system icon id of the icon that you want to show in the window (str)

​

returns:

user choice (retry-True, cancel-False) (bool)

PE.dialogs.ask_yes_no_cancel(title: str, message: str, icon='error')

This is a documented version of tkinter.messagebox.askyesnocancel()

​

function actions:

makes tkinter.messagebox.askyesnocancel() function. show a system input window.

​

parameters:

title - the window title (str)

message - the question (str)

icon - the tkinter system icon id of the icon that you want to show in the window (str)

​

returns:

user choice (yes-True, no-False, cancel-None) (bool/None)

PE.dialogs.ask_int(title: str, message: str, num_range=None)

This is a documented version of tkinter.simpledialog.askinteger() with a range that the user have to give a number in this range

set num_range to None for all numbers.

​

function actions:

makes tkinter.simpledialog.askinteger() function. show an input window and check if the input is in the current range.

​

parameters:

title - the window title (str)

message - the question (str)

num_range - the range that the input can be in (range/None)

​

returns:

user input (int)

PE.dialogs.ask_float(title: str, message: str, num_range=None)

This is a documented version of tkinter.simpledialog.askfloat() with a range that the user have to give a number in this range

set num_range to None for all numbers.

​

function actions:

makes tkinter.simpledialog.askfloat() function. show an input window and check if the input is in the current range.

​

parameters:

title - the window title (str)

message - the question (str)

num_range - the range that the input can be in (range/None)

​

returns:

user input (float)

PE.dialogs.ask_str(title: str, message: str)

This is a documented version of tkinter.simpledialog.askstring()

​

function actions:

makes tkinter.simpledialog.askstring() function. show an input window.

​

parameters:

title - the window title (str)

message - the question (str)

​

returns:

user input (str)

PE.dialogs.ask_bool_console(question: str, options_true=["yes", "y"], options_false=["no", "n"])

This is a simple way to get a bool value from the console input.

​

function actions:

keep asking for input until gets a string that is in the dataset.

​

parameters:

question - the question will be asked (str)

options_true - the list of 'True' inputs (list of strings -> list[str] - > ["",])

options_false - the list of 'False' inputs (list of strings -> list[str] - > ["",])

​

returns:

user input (bool)

PE.dialogs.ask_int_console(question: str, num_range: range)

This is a simple way to get an int value from the console input.

If can't you stand that when you use int(input()) your program crash because you accidentally pressed the '\' key, this function made for you.

​

function actions:

keep asking for input until gets a string that is intable and in the current range.

​

parameters:

question - the question will be asked (str)

num_range - the range that the input should be inside (range)

​

returns:

user input (int)

PE.dialogs.ask_float_console(question: str, num_range: range)

This is a simple way to get a float value from the console input.

If can't you stand that when you use float(input()) your program crash because you accidentally pressed the ']' key, this function made for you.

​

function actions:

keep asking for input until gets a string that is floatable and in the current range.

​

parameters:

question - the question will be asked (str)

num_range - the range that the input should be inside (range)

​

returns:

user input (float)

PE.dialogs.set_cursor_icon(icon: pygame.cursors.Cursor)

This is a simple way to change the cursor icon.

​

function actions:

keep asking for input until gets a string that is floatable and in the current range.

​

parameters:

icon - the icon that you want to set the cursor to (pygame.cursors.Cursor)

PE.dialogs.root

the tkinter root window that used to display all the tkinter dialogs and message boxes.

​

variable use:

used by all tkinter functions as a root.

Powered and secured by Wix © 2035

bottom of page