@name 结束进程列表 @author hwliang<2021-08-10> @param pids: string<进程pid列表> @return dict
(self,get=None,pids = None)
| 1459 | return False |
| 1460 | |
| 1461 | def kill_pids(self,get=None,pids = None): |
| 1462 | ''' |
| 1463 | @name 结束进程列表 |
| 1464 | @author hwliang<2021-08-10> |
| 1465 | @param pids: string<进程pid列表> |
| 1466 | @return dict |
| 1467 | ''' |
| 1468 | if get: pids = get.pids |
| 1469 | if not pids: return public.return_data(True, '没有进程') |
| 1470 | pids = sorted(pids,reverse=True) |
| 1471 | for i in pids: |
| 1472 | try: |
| 1473 | p = psutil.Process(i) |
| 1474 | p.terminate() |
| 1475 | except: |
| 1476 | pass |
| 1477 | return public.return_data(True, '进程已全部结束') |
| 1478 | |
| 1479 | |
| 1480 |
no test coverage detected