#! /usr/bin/python
# -*- coding: utf-8 -*-
import os
taskinfo = os.popen('netstat -ano | findstr 8084')
line = taskinfo.readline()
aList = line.split()
taskinfo.close()
pid = aList[4]
os.popen('taskkill /pid %s /f' % pid)
#! /usr/bin/python
# -*- coding: utf-8 -*-
import os
taskinfo = os.popen('netstat -ano | findstr 8084')
line = taskinfo.readline()
aList = line.split()
taskinfo.close()
pid = aList[4]
os.popen('taskkill /pid %s /f' % pid)
本文标题:python杀掉windows端口号对应进程
本文链接:https://www.haomeiwen.com/subject/vzpugxtx.html
网友评论