首页 > 技术文章 > Python——turtle生成图片保存

oddcat 2018-09-12 13:29 原文

代码示例如下:

from Tkinter import *
from turtle import *
import turtle


forward(100)
ts = turtle.getscreen()

ts.getcanvas().postscript(file="duck.eps") #.eps文件即postscript脚本

stackoverflow链接:https://stackoverflow.com/questions/4071633/python-turtle-module-saving-an-image

推荐阅读