TG-PlatformPlus/qml/debug/sysappexplorer/script/sysapp.py

26 lines
613 B
Python
Raw Permalink Normal View History

2026-03-02 14:29:58 +08:00
import os
from PyQt6 import *
from PyQt6.QtCore import *
class Sysapp(QObject):
def __init__(self):
super().__init__()
@pyqtSlot(str, result=bool)
def open_App(self, path):
try:
if not os.path.exists(path):
return False
path = path.replace('\\', '/')
if ' ' in path:
path = f'"{path}"'
import subprocess
subprocess.Popen(path, shell=True)
return True
except Exception as e:
print(f"open faild: {e}")
return False
sysapp = Sysapp()