一、这里用到了:String模块ascii_letters和digits
''.join(random.sample(string.ascii_letters + string.digits, 9))
1、random.sample(string.ascii_letters + string.digits, 9)表示随机抽取9位
2、str.join以某字符串,把抽取的字符连接起来
str = "-"; seq = ("a", "b", "c");
# 字符串序列
print str.join( seq );
输出a-b-c