python杀掉windows端口号对应进程
2017-12-27 本文已影响0人
暮水齐
#! /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)