我一直在跟踪那些无聊的事情。你知道吗
这个问题跟在我之前的两个问题之后:
Iterate a Nested Dictionary in Python
Iterate Dictionary in Python and Sum Totals by Category
我一直在使用ATBS中使用的方法将python代码中的一些数据打印到word文档中。以下是如何设置的片段:
dataFile = open('stocks.py', 'w')
wordFile = open('stocks.doc', 'w')
dataFile.write('allData = ' + pprint.pformat(stockData))
wordFile.write(pprint.pformat(sectors))
技术30% 医疗保健20% 财务30%
但我发现通过pprint方法并不容易。有什么好办法吗?你知道吗
我的第二个问题是,有没有更好的方法?我知道ATBS是一种使用python的新手方式,但我愿意尝试一种更好的方式,使用python在excel中分析数据,然后在Word中生成自动报告。你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐