display each record of list into a separate line in jython
how to display record of the list in different line
['0 , INDIVS08 , ODI_TEMP', '1 , C$_0EMPLOYEES , ODI_TEMP', '2 , C$_0PACS08 , ODI_TEMP']
i want to display as
'0 , INDIVS08 , ODI_TEMP' ,
'1 , C$_开发者_如何学C0EMPLOYEES , ODI_TEMP',
'2 , C$_0PACS08 , ODI_TEMP'
Thanks for all of your help
lst = ['0 , INDIVS08 , ODI_TEMP', '1 , C$_0EMPLOYEES , ODI_TEMP', '2 , C$_0PACS08 , ODI_TEMP']
print(',\n'.join(["'%s'" % s for s in lst]))
',\n'.join()
joins list, so it will be printed in separate lines with ending with comma.
["'%s'" % s for s in lst]
is a little compilated, but it adds '
for every item in lst
.
精彩评论