话说我在研究pywhatkit时搞了一下源程序,发现了这个:

data = requests.get(f"https://pywhatkit.herokuapp.com/handwriting?text={string}&rgb={rgb[0]},{rgb[1]},{rgb[2]}"
)

然后,我掏出了apifox,一试:

ohhhhhhhhhhh !
来,说说我发现的东西!


这是一个GET请求的API接口https://pywhatkit.herokuapp.com/handwriting,两个参数,分别是text(文字)和rgb(颜色)。
我找了一段简短的英文小故事来测试。接口无法处理中文。

A child was careless ramie stabbed, he rushed home and told his mother: I only lightly Pengyi what, it was my painful thorns.Mom said: Because of this, it will thorn you. if the next time you met Ramie, to a courageous and seize it, it will be in your hands become soft as silk, you will no longer be stabbed.It is said that many people are serving hard against soft.

我把它写成一个程序,一起来看:

from requests import get
t = input('Enter some English >>> ')
if len(t) > 1035:print('The content you entered is too long.')input()exit()color = (30,30,150)
params = {'text':t,'color':'%d,%d,%d' % (color[0],color[1],color[2])}
try:res = get('https://pywhatkit.herokuapp.com/handwriting',params=params)with open('text.png','wb') as f:f.write(res.content)print('\nSuccessful production.')input()
except Exception as e:print('Error :',e)


Python实现输出手写体图片相关推荐

  1. python plt输出eps图片打开后显示空白

    # plt调用gcf函数取得当前绘制的figure并调用savefig函数 eps_fig = plt.gcf() # 'get current figure' eps_fig.savefig('fo ...

  2. python制作图片数据集,Python 3 生成手写体数字数据集

    0.引言 平时上网干啥的基本上都会接触验证码,或者在机器学习学习过程中,大家或许会接触过手写体识别/验证码识别之类问题,会用到手写体的数据集: 自己尝试写了一个生成手写体图片的python程序,在此分 ...

  3. python怎么输出图片_python输出彩色图片python 时间处理

    在实际中遇到一个时间处理问题,需要将 Sep 06, 2014 19:30 (UTC 时间) 和 当前时间比较早晚,知道 此 2014-09-06 19:30 格式时间的运算.因此,在处理时,就想 w ...

  4. python字库转文字图片,Python输出汉字字库及将文字转换为图片

    用python输出汉字字库 问题1:假设我们知道汉字编码范围是0x4E00到0x9FA5,怎么从十六进制的编码转成人类可读的字呢? 问题2:怎么把unicode编码的字写入文件呢,如果直接用open( ...

  5. python画二维矩阵图_Python实现二维数组输出为图片

    Python实现二维数组输出为图片 对于二维数组,img_mask [[ 0 0 0 ..., 7 7 7] [ 0 0 0 ..., 7 7 7] [ 0 0 0 ..., 7 7 7] ..., ...

  6. python ffmpeg 视频转图片 视频转音频 播放音频 多张图片+音频转视频 多个视频合成一个视频 改变视频播放速度

    文章目录 视频转图片 视频转音频 播放音频 图片+音频 转 视频 多个视频合成一个视频 改变视频播放速度 视频转图片 #!/usr/bin/env python # -*- encoding: utf ...

  7. Python 小把戏之图片转字符串

    Python 小把戏之图片转字符串 #! /usr/bin/python3 # -*- coding: UTF-8 -*-from PIL import Image import argparse i ...

  8. python 等比例缩放图片 自写

    Python等比例缩放图片 使用了 OpenCV 进行图片的读取 输入:利用 cv2.imread 函数读取的 Mat 矩阵 输出:缩放后的 Mat 矩阵(示例代码为缩放到 512x512 大小,也可 ...

  9. Python中用numpy进行图片处理

    其实在Python中,我们也可以用numpy进行图片处理,今天一起来学习下吧. 1.图像的数组表示: from PIL import Image from pylab import * from nu ...

最新文章

  1. Spring Boot日志学习记录【2】
  2. 史上最全的长读长数据校错方法大比拼
  3. python画圣诞树代码-圣诞节!教你用Python画棵圣诞树
  4. 2.11 向量化-深度学习-Stanford吴恩达教授
  5. JDBC8.0 URL配置
  6. spring加载application.xml异常
  7. 【NOIP2016提高A组模拟10.15】打膈膜
  8. Maven学习总结(3)——使用Maven构建项目
  9. simple_html_dom.php 使用 乱码处理作者:gaoming13
  10. mipi差分信号原理
  11. 太赞了! 豆瓣9.3分的《Linux 命令行大全》.pdf 限时下载
  12. java hibernate 包_hibernatejar包官方下载-Hibernate.jar包下载 --pc6下载站
  13. 记录几个视频处理软件
  14. SQL语句:连接查询
  15. 苹果7p更新系统老是服务器出错,7p为什么无法更新系统 7p无法更新系统怎么办...
  16. Linux安装JDK-8-附有百度网盘链接
  17. AFX_EXT_CLASS的使用
  18. 2018校招携程测评,赞RP
  19. 信贷违约风险评估预测-kaggle项目
  20. 今天心情不错,写个随笔。

热门文章

  1. sonar (default-cli) on project webgoat-parent: Not inside a Git work tree 错误以及解决方案
  2. 周金涛:繁荣的起点并非沸腾的年代,或将在2020年出现首次证券市场大繁荣
  3. 离开汽车之家和新车评,那些我们喜欢的车评人会活的更好
  4. Vue 设置背景图片
  5. 输出由1、2、3、4四个数字组成的每位都不相同的所有三位数
  6. 云服务器无法访问解决办法
  7. Centos7安装docker并更改阿里云下载镜像地址(附带windows10安装docker教程)
  8. java实现随机点名器
  9. Failed to load the JNI shared library 的解决方法
  10. Probability and Stochastic Models(1) —— 研一新课学习笔记