def graphic_gif(self, q, a, filename): "回答データをグラフィックとして描画" import nldraw images = nldraw.draw(q, a, self) base = re.sub("\.gif", "", filename) num = 1 res = [] for img in images: file = "%s.%d.gif" % (base, num) img.writeGif(file) res.append(file) num += 1 return res
def graphic_png(self, q, a, filename): "回答データをグラフィックとして描画" import nldraw images = nldraw.draw(q, a, self) base = re.sub("\.png", "", filename) num = 0 res = [] for img in images: file = "%s.%d.png" % (base, num) img.writePng(file) #print file res.append(file) num += 1 return res