Why after pressing context menu button from python code below doesn't receive any…
- User
Why after pressing context menu button from python code below doesn't receive any sys.argv?
import winreg, sys
codekey_path = r"*\shell\Avifify" # Add entry for `SUPPORTED_EXTS` and for multi selection for ext in SUPPORTED_EXTS: # Use system file associations to specify the extension context key_path = r"SystemFileAssociations\." + ext.lower() + r"\shell\Avifify" try: # Create the main context menu key for the extension. with winreg.CreateKey(winreg.HKEY_CLASSES_ROOT, key_path) as key: winreg.SetValueEx(key, None, 0, winreg.REG_SZ, "Avifify") # Enable multi-selection support. winreg.SetValueEx(key, "MultiSelectModel", 0, winreg.REG_SZ, "Player") # Create the 'command' subkey to define the action. with winreg.CreateKey(winreg.HKEY_CLASSES_ROOT, key_path + r"\command") as cmd_key: command = f'"{sys.executable}" "{os.path.abspath(__file__)}" %*' winreg.SetValueEx(cmd_key, None, 0, winreg.REG_SZ, command) print(f"Context menu entry added for .{ext.lower()} files successfully.") except Exception as e: print(f"Failed to add context menu entry for .{ext.lower()}: {e}")
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.