标签 Python 下的文章

#coding:utf-8
name = 'Zed A. Shaw'
age = 8.123 # not a lie
height = 74 # inches
weight = 180 # lbs
eyes = 'Blue'
teeth = 'White'
hair = 'Brown'

print "His name is %s" %name

这里可以将常量也以这种方式打印出来

- 阅读剩余部分 -

# -*- 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()