-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfolder_picker.py
More file actions
34 lines (30 loc) · 881 Bytes
/
Copy pathfolder_picker.py
File metadata and controls
34 lines (30 loc) · 881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env python3
"""
Folder Picker Utility for LoopSleuth
- Opens a native folder picker dialog
- Copies the selected folder path to the clipboard (requires pyperclip)
- Prints the path to the terminal as a fallback
Usage:
python folder_picker.py
If pyperclip is not installed, run:
pip install pyperclip
"""
import sys
import tkinter as tk
from tkinter import filedialog
try:
import pyperclip
HAS_CLIP = True
except ImportError:
HAS_CLIP = False
root = tk.Tk()
root.withdraw()
folder = filedialog.askdirectory(title="Select a folder to scan with LoopSleuth")
if folder:
if HAS_CLIP:
pyperclip.copy(folder)
print(f"[LoopSleuth] Folder path copied to clipboard:\n{folder}")
else:
print(f"[LoopSleuth] Folder path (install pyperclip for clipboard support):\n{folder}")
else:
print("[LoopSleuth] No folder selected.")