1.字符串是list列表的形式
str='2257,4018,1096'
target_list = [int(x) for x in str.split(',')]print target_list
[2257, 4018, 1096]
2.把字符串直接转换为list
str = 'abcde'
list = list(str)
print list
['a', 'b', 'c', 'd', 'e']
2.把liest转换为字符串
str_convert = ''.join(list)
str_convert
'abcde'