-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
27908ea
commit d08fe24
Showing
4 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
/playwright-report/ | ||
/blob-report/ | ||
/playwright/.cache/ | ||
/venv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import pygetwindow as gw | ||
|
||
def print_active_window_title(): | ||
try: | ||
active_window = gw.getActiveWindow() | ||
if active_window: | ||
print(f"Active window title: {active_window.title}") | ||
else: | ||
print("No active window detected.") | ||
except Exception as e: | ||
print(f"An error occurred: {e}") | ||
|
||
print_active_window_title() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import pyautogui | ||
import random | ||
import time | ||
|
||
def move_mouse_randomly(duration_seconds): | ||
end_time = time.time() + duration_seconds | ||
while time.time() < end_time: | ||
# Get the size of the primary monitor. | ||
screen_width, screen_height = pyautogui.size() | ||
|
||
# Generate a random position within the screen bounds. | ||
x = random.randint(0, screen_width) | ||
y = random.randint(0, screen_height) | ||
|
||
# Move the mouse to the random position. | ||
pyautogui.moveTo(x, y, duration=0.1) | ||
|
||
# Wait a bit before moving again to make the movements noticeable. | ||
time.sleep(0.5) | ||
|
||
# Example usage: Move the mouse randomly for 10 seconds. | ||
move_mouse_randomly(10) |
Empty file.