CanvasSBG.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:CanvasSBG 作者: BRueckert 项目源码 文件源码
def genTeachReport(self):
        '''
        Creates a CSV file with name, loginID, and group scores for each student in 
        app_data fullGBook. Headers are included.
        '''
        csvOut = []
        heads = ['name','login_ID',]
        for i in self.app_data['fullGBook'][0]['results']:
            heads.append(i['title'])
        for i in self.app_data['fullGBook']:
            toAdd = []
            toAdd.append(i['name'])
            toAdd.append(i['login_id'])
            for k in i['results']:
                for j in heads:
                    if j == k['title']:
                        toAdd.append(k['mean'])
            csvOut.append(toAdd)

        with open('StandardsReport.csv', 'w', newline='') as csvfile:
            writeOut = csv.writer(csvfile, delimiter=',',dialect='excel')
            writeOut.writerow(heads)
            for i in csvOut:
                writeOut.writerow(i)
        messagebox.showinfo(title='Export', message='Data exported to CSV')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号