#!/usr/bin/env python #coding: utf8 import os import sys import mkpasswd //这是之前写的,直接调用 import string content = """username: ${user} password: ${password}""" t = string.Template(content) def adduser(username, pwd): os.system("useradd %s" % username) os.system("echo %s | passwd --stdin %s" % (