26 lines
613 B
Python
26 lines
613 B
Python
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() |