本文做者:魏泯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