Answer the question
In order to leave comments, you need to log in
How to convert list to string?
You need to convert list to a string.
for row in data_body:
print(row)
data = ','.join(row)
[None, u'1516482864.000000', 627, 0, u'9227943', 41, 60.0, u'transaction', u'+345348880', u'5000.00', u'345188435', 472, 1463, u'2018-01-20 21:12:19.019598', u'6be2d345dd43af6fc23', 6225064, u'222222222']
Traceback (most recent call last):
File "app.py", line 72, in <module>
data = ','.join(row)
TypeError: sequence item 0: expected string, NoneType found
Answer the question
In order to leave comments, you need to log in
data = ','.join(str(i) for i in row)
if None should be removed
data = ','.join(str(i) for i in row if i is not None)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question