You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: TkEasyGUI/dialogs.py
+24-1Lines changed: 24 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -718,7 +718,30 @@ def popup_get_file(
718
718
no_window: Optional[bool] =None, # for compatibility
719
719
**kw,
720
720
) ->Optional[str]:
721
-
"""Popup a file selection dialog. Return the file selected."""
721
+
"""
722
+
Popup a file selection dialog. Return the file selected.
723
+
724
+
- if `save_as` is False, show open file dialog.
725
+
- if `save_as` is True, show save as dialog.
726
+
- if `multiple_files` is True, can select multiple files and return a string joined by `files_delimiter`(default is FILES_DELIMITER).
727
+
- `file_types` is a list of tuples (description, file extension) or a list of file extensions. For example: [("Text Files", "*.txt"), ("All Files", "*.*")] or ["*.txt", "*.py"].
728
+
729
+
```py
730
+
# select a file to open
731
+
file_path = eg.popup_get_file("Select a file to open:", "Open File")
732
+
print(file_path)
733
+
# select a file to save
734
+
save_path = eg.popup_get_file("Select a file to save:", "Save File", save_as=True)
0 commit comments