Skip to content

Commit

Permalink
3.3.3
Browse files Browse the repository at this point in the history
- added file_selector
  • Loading branch information
SirDank committed Apr 8, 2023
1 parent 850596f commit 2ca01e8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions dankware/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,24 @@ def tmp():

# --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

def file_selector(title: str = "Open", icon_path: str = "") -> str:

"""
Opens file selector and returns selected file path
- Allows custom title and icon
"""

from tkinter import Tk
from tkinter.filedialog import askopenfilename

root = Tk()
root.withdraw()
if icon_path: root.iconbitmap(icon_path)
file_path = askopenfilename(title=title)
return file_path

# --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

def cls() -> None:

"""
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="dankware",
version="3.3.2",
version="3.3.3",
author="SirDank",
author_email="[email protected]",
description="Python module with various features.",
Expand Down

0 comments on commit 2ca01e8

Please sign in to comment.