# -*- coding: utf-8 -*-
#!/usr/bin/python
import os
import re

mykvm=os.popen('virsh list').readlines()

for line in kymvm:
   kvmid=re.search( r'kvm.[0-9]\d*', line)
   if kvmid:
        print kvmid.group()

标签: Python

添加新评论