本文做者:魏泯python
个人博客源地址:https://www.cnblogs.com/Asterism-2012/ide
效率魔法师,本文最后更新时间:2019年1月28日工具
Python版本:3.6字体
turtle是python内置的标准包。code
今天使用Turtle开发了一个小小的画图程序,配合pyinstaller打包为一个.exe
可执行文件。
在学习与开发的摸索了一个小时左右,我来总结一下今天的收获:orm
.exe
文件发送到没有python环境的机器上(就是朋友的电脑)也能够正常把图画出来# -*- coding: utf-8 -*- import turtle t= turtle.Turtle() t.hideturtle() t.write("霜叶红于二月花", font=("微软雅黑", 14, "normal")) #fonttype有normal, bold, italic, underline # t.write("This is a test", font=("Arial", 14, "bold")) #fonttype能够自由组合,如"bold italic" import time t.right(90) # 将画笔右转90度(就是朝正下方) t.penup() # 将画笔拿起来 t.forward(100) # 将画笔向前移动100(多是像素)的距离? t.write("hello") # 在当前画笔所在的地方,以默认字体打印字符串 time.sleep(10)
*回到文章目录再看看*
blog