比如[1,2,3,4] 要变成("1","2","3","4")
['39f6d8cb-d989-4e88-2347-3b18ebaf4872', '39fa01a8-7aff-1583-d218-ef4b31693923'] 变成('39f6d8cb-d989-4e88-2347-3b18ebaf4872', '39fa01a8-7aff-1583-d218-ef4b31693923')
list1 = [1, 2, 3, 4] str1 = ','.join('"{0}"'.format(x) for x in list1) str1 = '({0})'.format(str1) print(str1) l = ['39f6d8cb-d989-4e88-2347-3b18ebaf4872', '39fa01a8-7aff-1583-d218-ef4b31693923'] l1 = str(tuple(l)) print(l1)
下一个:检测IP地址的正则表达式