我有两个专栏:
我试着在两个列中进行连接,最后只得到一个这样的列:
但我不确定在使用Python工作表.write时如何做到这一点
这里有人有这门课的经验吗
当然,对于已经使用过此类的用户来说,这应该是一个简单的解决方案
import xlsxwriter
worksheet.write('A' + str(x), unicode(Date , 'utf-8'), headerBorderFormat)
worksheet.write('B' + str(x), unicode(Username, 'utf-8'), headerBorderFormat)
worksheet.write('C' + str(x), unicode(Date + ' / ' + Username, 'utf-8'), headerBorderFormat)
# get and display one row at a time.
for row in details:
x += 1
worksheet.write('A' + str(x), row[0], dateFormat)
worksheet.write('B' + str(x), row[1], tableDataFormat)
#here I have to concat row[0] + ' / ' + row[1]
workbook.close()
如果
row
的第一个元素是datetime对象,第二个元素是字符串,那么在提供所需的日期格式(请参见https://strftime.org/)时,类似的内容可以工作:相关问题 更多 >
编程相关推荐