Using python csv writer without quotations

前端 未结 4 927
猫巷女王i
猫巷女王i 2020-12-31 11:47

I\'m trying to write a list of strings like below to a file separated by the given delimiter.

res = [u\'123\', u\'hello world\']

When I try

4条回答
  •  情歌与酒
    2020-12-31 12:33

    Do you need the csv lib? Just join the strings...

    >>> res = [u'123', u'hello'] 
    >>> print res
    [u'123', u'hello']
    >>> print " ".join(res)
    123 hello
    

提交回复
热议问题