MCPcopy Create free account
hub / github.com/ZyphrZero/palworld-python-script / close_process

Method close_process

src/task_scheduler.py:155–164  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

153
154 # 关闭路径匹配成功的进程
155 def close_process(self):
156 for proc in psutil.process_iter(['name', 'exe']):
157 try:
158 if self.appName.lower() in proc.info['name'].lower():
159 if os.path.normpath(self.appName_path) == os.path.normpath(proc.info['exe']):
160 proc.kill()
161 print(f"[ 进程关闭 ] 已关闭位于{proc.info['exe']} 的 {self.appName}")
162 return
163 except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
164 pass
165
166 # 解压文件
167 def unzip_files(self):

Callers 2

check_rconMethod · 0.95
polling_taskMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected