不知道怎么向女神表白?Python三大神技分分钟带你成功逆袭!

'.join([''.join([('I LOVE U'[(x-y) % 8] if ( (x*0.05)**2 + (y*0.1)**2 -1)**3 - (x*0.05)**2 * (y*0.1)**3 <=0 else ' ')
for x in range(-30,30)]) for y in range(15, -15, -1)]))
OVE UI LOVE UI LO UI LOVE UI LOVE U
LOVE UI LOVE UI LOVE UI LOVE UI LOVE UI L
LOVE UI LOVE UI LOVE UI LOVE UI LOVE UI LOV
LOVE UI LOVE UI LOVE UI LOVE UI LOVE UI LOVE
OVE UI LOVE UI LOVE UI LOVE UI LOVE UI LOVE U
VE UI LOVE UI LOVE UI LOVE UI LOVE UI LOVE UI
E UI LOVE UI LOVE UI LOVE UI LOVE UI LOVE UI
UI LOVE UI LOVE UI LOVE UI LOVE UI LOVE UI L
UI LOVE UI LOVE UI LOVE UI LOVE UI LOVE UI LO
LOVE UI LOVE UI LOVE UI LOVE UI LOVE UI LO
OVE UI LOVE UI LOVE UI LOVE UI LOVE UI LO
VE UI LOVE UI LOVE UI LOVE UI LOVE UI LOV
UI LOVE UI LOVE UI LOVE UI LOVE UI LO
LOVE UI LOVE UI LOVE UI LOVE UI LO
OVE UI LOVE UI LOVE UI LOVE UI LO
UI LOVE UI LOVE UI LOVE UI L
LOVE UI LOVE UI LOVE UI
VE UI LOVE UI LOVE UI
I LOVE UI LOVE
VE UI LOV
I L
L
for y in range(15, -15, -1):
line_c = []
letters = ''
for x in range(-30, 30):
expression = ((x*0.05)**2+(y*0.1)**2-1)**3-(x*0.05)**2*(y*0.1)**3
if expression <= 0:
letters += words[(x-y) % len(words)]
else:
letters += ' '
line_c.append(letters)
line += line_c
print('
'.join(line))
import time
for c in words.split():
line = []
for y in range(15, -15, -1):
line_c = []
letters = ''
for x in range(-30, 30):
expression = ((x*0.05)**2+(y*0.1)**2-1)**3-(x*0.05)**2*(y*0.1)**3
if expression <= 0:
letters += c[(x-y) % len(c)]
else:
letters += ' '
line_c.append(letters)
line += line_c
print('
'.join(line))
time.sleep(1)
生成照片墙
Arguments:
text... Text of picture wall, if not defined this will generage a rectangle picture wall
Options:
-s, --font-size=INT font size of a clear value (default: 20)
-e, --edge-len=INT sub picture's egde length (default: 50)
-w, --wall-width=INT picture number of rectangle width (default: 20)
-l, --wall-length=INT picture number of rectangle length (default: 10)
-d, --pic-dir=STR picture's path (default: ./img)
-o, --out-dir=STR output dir (default: ./out/)
-p, --font-path=STR font path (default: ./demo.ttf)
-m, --method=STR decrator method, now accept 'alpha', 'size' (default: alpha)
Other actions:
-h, --help Show the help




- 子照片的处理方式有待提升,目前采用的只是根据字体像素透明度控制透明度,还可以抽象出来让用户选择控制方式~比如:
- 根据字体像素透明度控制子图形状
- 根据字体像素透明度控制子图颜色亮度
- 或者直接采用圆形裁剪子图
生成文字云
Arguments:
par...
Options:
-t, --text-file=STR text file that contain all you word (default: ./data/love_letter.txt)
-s, --stop-file=STR the stop word which can't be considered (default: ./data/stopwords.txt)
-c, --color-img=STR the color map img (default: ./data/pink.jpg)
-m, --mask-file=STR the mask img for the word
-o, --out-file=STR output file path which should with sufix of png/jpg... (default: ./out/word_cloud.png)
-p, --font-path=STR font path (default: ./demo.ttf)
Other actions:
-h, --help Show the help

- 增加背景照片和注释文字形成最终类似下图的效果

不知道怎么向女神表白?Python三大神技分分钟带你成功逆袭!的更多相关文章
- python三大神器之virtualenv pip, virtualenv, fabric通称为pythoner的三大神器。
python三大神器之virtualenv pip, virtualenv, fabric通称为pythoner的三大神器. virtualenv virtualenv------用来建立一个虚拟 ...
- python三大神器之virtualenv
virtualenv virtualenv用来管理python项目环境,隔离出一个只属于这个项目的虚拟python环境(windows和Linux用法一样). 首先你需要安装virtualenv模块 ...
- python三大神器之pip
pip是一款管理python各类包和库的工具,非常好用.下文介绍常用的一些命令. ● 安装:pip install 库名 也可以指定版本:pip install 库名=版本 ● 卸载:pip unin ...
- python三大神器之fabric
Fabric Fabric是一个python的远程执行shell的库,同时它也是一个命令行工具.它提供了丰富的同 SSH 交互的接口,可以用来在本地或远程机器上自动化.流水化地执行 Shell 命令. ...
- python三大神器之fabric(2.0新特性)
fabric经常出现在自动化运维领域,批量处理一些运维工作.fabric是在paramiko之上又封装了一层,操作起来更加简单易用. 本来只是想写个博客记录一下,然后发现之前写的代码不能运行了,报以下 ...
- python学习之路(一)屌丝逆袭之路
变量 ...
- Python三大器之生成器
Python三大器之生成器 生成器初识 什么是生成器 生成器本身属于迭代器.继承了迭代器的特性,惰性求值,占用内存空间极小. 为什么要有生成器 我们想使用迭代器本身惰性求值的特点创建出一个可以容纳百万 ...
- Python 三大神器
Python 三大神器 Python 中有很多优秀的包,本文主要讲一下 pip, virtualenv, fabric 1. pip 用来包管理 文档:https://pip.pypa.io/en/l ...
- Python三大器之迭代器
Python三大器之迭代器 迭代器协议 迭代器协议规定:对象内部必须提供一个__next__方法,对其执行该方法要么返回迭代器中的下一项(可以暂时理解为下一个元素),要么就引起一个Stopiterat ...
随机推荐
- angularjs路由监听,uirouter感知路由变化,解决uirouter路由监听不生效的问题
壹 ❀ 引 angularjs除了惊为天人的双向数据绑定外,路由也是出彩的一笔,通过路由配置,我们能在不发起页面跳转的情况下,对当前页内容进行整体更新,angularjs提供了ngRoute模块用于 ...
- 干货:.net core实现读取appsettings.json配置文件(建议收藏)
看好多人不懂在.NET CORE中如何读取配置文件,我这里分两篇,这一篇介绍怎样通过appsettings.json配置读取文件信息.这里我会教大家两种方式: 第一种直接放到通用类库,那里想调往那调. ...
- .net core 中间件使用
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; usi ...
- linux脚本判断当前的linux版本是6还是7
#!/bin/sh version="release 7." release=$(cat /etc/redhat-release) echo $release result=$(e ...
- SharePoint PowerShell 创建网站栏
前言 最近,有这么个需求,需要使用PowerShell为网站集创建网站栏,好吧,直接看代码吧. Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorA ...
- Thymeleaf常用语法:条件判断 if、switch case
if语句条件判断使用th:if,它会判断表达式是否成立,表达式的结果支持boolean.number.character.String及其他类型.满足下面情况,if语句成立:(1) 表达式的结果是数字 ...
- selinux disable
临时关闭: [root@localhost ~]# getenforceEnforcing [root@localhost ~]# setenforce 0[root@localhost ~]# ge ...
- Django2.1 更新说明!
Django2.1版本发布时间:2018-8-1 一.Python兼容性 Django2.1只支持Python 3.5. 3.6和3.7以上版本.Django2.0是最后一个支持Python3.4及一 ...
- 非法指令(Illegal Instruction)问题定位
关键词:Illegal Instruction.SIGILL等. 进程在运行过程中会收到SIGILL信号,此类错误是由操作系统发送给进程的. SIGILL是某个进程中的某一句不能被CPU识别指令,这些 ...
- python xlwt写入excel操作
引用https://www.cnblogs.com/python-robot/p/9958352.html 安装 $ pip install xlwt 例子: import xlwt # 创建一个wo ...