爱她就用python给她画个小心心 ♥(ˆ◡ˆԅ)
from turtle import * a = Turtle()
screensize(400, 300, "blue")
setup(width=1300, height=650, startx=20, starty=20)
a.speed(10)
a.hideturtle()
a.pensize(2)
a.color('red', 'pink')
a.up()
a.goto(200, 0)
a.down()
a.left(150)
a.begin_fill()
a.speed(1)
a.forward(51)
a.speed(50)
for i in range(150):
a.forward(1)
a.right(0.3)
a.speed(50)
for i in range(210):
a.forward(1)
a.right(0.786)
a.left(120)
a.speed(50)
for i in range(210):
a.forward(1)
a.right(0.786)
a.speed(50)
for i in range(150):
a.forward(1)
a.right(0.3)
a.speed(1)
a.forward(51)
a.end_fill() # 画笔朝向x轴正方向
a.setheading(0)
a.up()
a.goto(-80, -100)
a.down()
a.left(150)
a.begin_fill()
a.speed(1)
a.forward(51 * 1.5)
a.speed(50)
for i in range(150):
a.forward(1.5)
a.right(0.3)
a.speed(50)
for i in range(210):
a.forward(1.5)
a.right(0.786)
a.left(120)
a.speed(50)
for i in range(210):
a.forward(1.5)
a.right(0.786)
a.speed(50)
for i in range(150):
a.forward(1.5)
a.right(0.3)
a.speed(1)
a.forward(51 * 1.5)
a.end_fill() # 画穿心直线
a.pensize(7)
a.setheading(0)
a.up()
a.goto(-400, 0)
a.down()
a.left(15)
a.forward(150)
a.up()
a.goto(339, 175)
a.down() # 画箭头
a.forward(150)
a.pensize(1)
a.speed(5)
a.color('red', 'red')
a.begin_fill()
a.left(120)
a.forward(20)
a.right(150)
a.forward(35)
a.right(120)
a.forward(35)
a.right(150)
a.forward(20)
a.end_fill()
a.up()
a.goto(400, -300)
a.down()
a.write('作者:爱苗苗的凡哥', move = True, align = 'left', font = ('楷体', 20, 'normal'))
done()
爱她就用python给她画个小心心 ♥(ˆ◡ˆԅ)的更多相关文章
- python运用turtle 画出汉诺塔搬运过程
python运用turtle 画出汉诺塔搬运过程 1.打开 IDLE 点击File-New File 新建立一个py文件 2.向py文件中输入如下代码 import turtle class Stac ...
- python生成字符画
python生成字符画 这个idea来自于实验楼,非常适合练习PIL的像素处理,更重要的是非常有意思. 环境配置 依赖的第三方库就是PIL(Python Image Library),可以直接使用pi ...
- .NET WinForm画树叶小程序
看了一片文章(http://keleyi.com/a/bjac/nurox416.htm),是使用分型画树叶,代码是Java的,因为Java很久没弄了,改用C#实现,下载地址: 画树叶小程序下载 核心 ...
- Python(五)编程小实例
Python(五)编程小实例 抓取网页信息,并生成txt文件内容! Python抓取网页技能--Python抓取网页就是我们常看见的网络爬虫,我们今天所要用到的就是我们Python中自带的模块,用这些 ...
- 用Python将一个列表分割成小列表
用Python将一个列表分割成小列表 2018年01月15日 11:09:25 幸福丶如此 阅读数:16842 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.cs ...
- python垃圾回收机制与小整数池
python垃圾回收机制 当引用计数为0时,python会删除这个值. 引用计数 x = 10 y = x del x print(y) 10 引用计数+1,引用计数+1,引用计数-1,此时引用计数为 ...
- [Python]Python 使用 for 循环的小例子
[Python]Python 使用 for 循环的小例子: In [7]: for i in range(5): ...: print "xxxx" ...: print &quo ...
- [python]python 遍历一个list 的小例子:
[python]python 遍历一个list 的小例子: mlist=["aaa","bbb","ccc"]for ss in enume ...
- python+pcap+dpkt 抓包小实例
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 网络数据包捕获与分析程序 """ imp ...
随机推荐
- http学习总结及思考
针对前面几章的学习,加上在学长的指导下,希望对前面知识进行简单总结. 1.在报文的7个方法中,最常用的是:Head和Post 响应头:If-Modified-Since HEAD -> 服务器返 ...
- stm32 输入捕获学习(二)
(本文参考STM32 开发指南 V1.3 -- ALIENTEK 战舰 STM32 开发板库函数教程 ) 1. 实验设计 我们用 TIM5 的通道 1(PA0)来做输入捕获,捕获 PA0 上高电 ...
- DevExtreme 搭建Node.js开发环境
简介 DevExtreme is a component suite for creating highly responsive web applications for touch devices ...
- fileupload NPOI导入EXECL数据
fileupload JS @section scripts{ <script src="~/Content/js/fileupload/vendor/jquery.ui.widget ...
- Oracle 求昨天 上个月 去年 日期
到公司发现有一个报表没有收到,查看后发现原来是Oracle数据源异常. ' day, 'yyyyMMdd') AS enddata FROM DUAL; 上面这个sql求上个月今天和昨天.一般情况下不 ...
- 部署Cube报错,用户登录失败;280000
在创建SSAS项目过程中,创建数据源.数据源视图.多维数据集.纬度等一切都没有问题.但是在“进程”这一步的时候,发现总是报错,提示如下. OLE DB 错误: OLE DB 或 ODBC 错误 : 用 ...
- [Maven] Project build error: 'packaging' with value 'jar' is invalid. Aggregator projects require 'pom' as packaging.
将<packaging>jar</packaging> 改为<packaging>pom</packaging>
- Object公用方法
Object是所有类的父类,任何类都默认继承Object. Object类到底实现了哪些方法? 1.clone方法 保护方法,实现对象的浅复制,只有实现了Cloneable接口才可以调用该方法,否 ...
- [LeetCode]19. Remove Nth Node From End of List删除链表的倒数第N个节点
Given a linked list, remove the n-th node from the end of list and return its head. Example: Given l ...
- hibernate 注解不给提示
1.alt + / 会给提示 2.上面这种稍微麻烦一点,如果需要写了@就直接给提示,就需要设置一下: a)Window - preferences b)搜 content assist,选中 Java ...