uuid 可以做各种免费的活动的兑换码。
#!/usr /bin/env python
# -*- coding: utf-8 -*-
import uuid
for i in xrange(0, 3):
code = str(uuid.uuid1())
print code #ab275e30-5d8e-11e3-8d93-206a8a654ece
abc = code.split('-')
print abc #['ab275e30', '5d8e', '11e3', '8d93', '206a8a654ece']
delimiter = ''#分隔符
code = delimiter.join(abc)
#print code
print "============"
list1 = ['1', '2', '3']
str1 = ''.join(list1)
print str1
print ">>>>>>>>"
list2 = [1, 2, 3]
str2 = ''.join(str(e) for e in list2)
print str2
print "++++++++++++++++++"
str = 'abcde'
listy = list(str)
print listy
str_convert = ''.join(listy)
print str_convert