Skip to content

Commit

Permalink
3.3.2
Browse files Browse the repository at this point in the history
added:
- hide_window()
- show_window()
- hide_window_for(duration)
  • Loading branch information
SirDank committed Mar 30, 2023
1 parent 691e825 commit 850596f
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
39 changes: 39 additions & 0 deletions dankware/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,45 @@ def animate_image(self, current_frame=0):

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

def hide_window() -> None:

"""
Hides console window
"""

from ctypes import windll

hWnd = windll.kernel32.GetConsoleWindow()
windll.user32.ShowWindow(hWnd, 0)

def show_window() -> None:

"""
Shows console window
"""

from ctypes import windll

hWnd = windll.kernel32.GetConsoleWindow()
windll.user32.ShowWindow(hWnd, 1)

def hide_window_for(duration: int = 3) -> None:

"""
Hides console window for the given duration
"""

from concurrent.futures import ThreadPoolExecutor

def tmp():
hide_window()
time.sleep(duration)
show_window()

ThreadPoolExecutor(10).submit(tmp)

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

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.1",
version="3.3.2",
author="SirDank",
author_email="SirDankenstein@protonmail.com",
description="Python module with various features.",
Expand Down

0 comments on commit 850596f

Please sign in to comment.