哪些 Python 库让你相见恨晚?

哪些 Python 库让你相见恨晚?可能有些人见过这个问题,其实这就是知乎上的一个提问,相见恨晚意思是遗憾相识太晚,也就是哪些 Python 让你遗憾相识太晚?这个问题对每个人及每个人的不同阶段可能都会有所不同,所以大家也不用纠结于别人与自己看法是否相同的问题,本文选取自己之前回答中几个有特点的库向大家介绍一下。

face-mask

face-mask 实现了给照片带口罩以及检测是否戴口罩的功能,使用之前需执行

pip install face-mask 

举一个我之前实现的示例,因当时在播电视剧《猎狐》,所以就选了猎狐 F4 的照片为原型,原图如下:

实现给照片带口罩,执行命令 face-mask x.PNG --red,效果如下:

检测照片是否带口罩,执行命令 python pytorch_infer.py --img-path C:UsersadminDesktopxx.PNG,效果如下:

很多人学习python,不知道从何学起。
很多人学习python,掌握了基本语法过后,不知道在哪里寻找案例上手。
很多已经做案例的人,却不知道如何去学习更加高深的知识。
那么针对这三类人,我给大家提供一个好的学习平台,免费领取视频教程,电子书籍,以及课程的源代码!
QQ群:1156465813

myqr

通过使用 myqr,我们只需几行 Python 代码即可生成炫酷的动态二维码,使用之前需执行

pip install myqr

看一下我之前实现的示例,效果可以描述为:把一张动态图片制作成二维码。

cutecharts

与 Matplotlib 、pyecharts 等常见的图表不同,使用 cutecharts 可以生成手绘风格的各种图表,实现之前需执行

pip install cutecharts

看一下相应效果:

项目地址为:https://github.com/cutecharts/cutecharts.py,如果感觉兴趣的话,可以去看一下,具体使用里面也有相应介绍,这里不再多说。

you-get

you-get 可以说是一个神器,一行命令即可下载很多网站视频,使用之前需执行

pip install you-get

当时《后浪》视频刷爆 B 站,所以就以下载《后浪》做了示例,如图所示:

colorama

colorama 可以跨多终端,显示字体不同的颜色和背景,使用之前需执行

pip install colorama

举一个我之前实现的示例,效果如下:

实现代码如下:

import time, colorama
from random import randint

colorama.init(convert=True)
RED = colorama.Fore.RED + colorama.Style.BRIGHT
CYAN = colorama.Fore.CYAN + colorama.Style.BRIGHT
GREEN = colorama.Fore.GREEN + colorama.Style.BRIGHT
YELLOW = colorama.Fore.YELLOW + colorama.Style.BRIGHT
MAGENTA = colorama.Fore.MAGENTA + colorama.Style.BRIGHT

# 打印抬头
for i in range(1, 35):
    print('')
# *的位置
heartStars = [2, 4, 8, 10, 14, 20, 26, 28, 40, 44, 52, 60, 64, 76]
# 空格的位置
heartBreakLines = [13, 27, 41, 55, 69, 77]
# 玫瑰的空列位置
flowerBreakLines = [7, 15, 23, 31, 39, 46]

# 添加空列
def addSpaces(a):
    count = a
    while count > 0:
        print(' ', end='')
        count -= 1

# 添加空行
def newLineWithSleep():
    time.sleep(0.3)
    print('
', end='')

play = 0
while play == 0:
    Left_Spaces = randint(8, 80)
    addSpaces(Left_Spaces)
    # 画心
    for i in range(0, 78):
        if i in heartBreakLines:
            newLineWithSleep()
            addSpaces(Left_Spaces)
        elif i in heartStars:
            print(RED + '*', end='')
        elif i in (32, 36):
            print(GREEN + 'M', end='')
        elif i == 34:
            print(GREEN + 'O', end='')
        else:
            print(' ', end='')
    newLineWithSleep()
    addSpaces(randint(8, 80))
    print(CYAN + '祝天下母亲节日快乐!', end='')
    newLineWithSleep()
    newLineWithSleep()
    Left_Spaces = randint(8, 80)
    addSpaces(Left_Spaces)
    # 画花
    for i in range(0, 47):
        if i in flowerBreakLines:
            newLineWithSleep()
            addSpaces(Left_Spaces)
        elif i in (2, 8, 12, 18):
            print(MAGENTA + '{', end='')
        elif i in (3, 9, 13, 19):
            print(MAGENTA + '_', end='')
        elif i in (4, 10, 14, 20):
            print(MAGENTA + '}', end='')
        elif i in (27, 35, 43):
            print(GREEN + '|', end='')
        elif i in (34, 44):
            print(GREEN + '~', end='')
        elif i == 11:
            print(YELLOW + 'o', end='')
        else:
            print(' ', end='')
    print('
', end='')

总结

本文选取了自己之前回答中个人认为有一些特点的库,大家如果对这个问题感兴趣的话,可以到问题下面看看其他回答,看看能不能发现让自己相见恨晚的 Python 库。

以下内容无用,为本篇博客被搜索引擎抓取使用
(* ̄︶ ̄)(* ̄︶ ̄)(* ̄︶ ̄)(* ̄︶ ̄)(* ̄︶ ̄)(* ̄︶ ̄)(* ̄︶ ̄)(* ̄︶ ̄)
python 是干什么的 零基础学 python 要多久 python 为什么叫爬虫
python 爬虫菜鸟教程 python 爬虫万能代码 python 爬虫怎么挣钱
python 基础教程 网络爬虫 python python 爬虫经典例子
python 爬虫
(* ̄︶ ̄)(* ̄︶ ̄)(* ̄︶ ̄)(* ̄︶ ̄)(* ̄︶ ̄)(* ̄︶ ̄)(* ̄︶ ̄)(* ̄︶ ̄)
以上内容无用,为本篇博客被搜索引擎抓取使用

原文地址:https://www.cnblogs.com/shuchongzeishuai/p/14028779.html