做网站的是什么职业,视频直播app源码,手机怎么做图纸设计,芜湖营销型网站建设✅ 包含编程资料、学习路线图、源代码、软件安装包等#xff01;【[点击这里]】#xff01; 01、 图片优化器
使用这个很棒的自动化脚本#xff0c;可以帮助把图像处理得更好#xff0c;你可以像在 Photoshop 中一样编辑它们。该脚本使用流行的是 Pillow 模块
# Image Op…✅包含编程资料、学习路线图、源代码、软件安装包等【[点击这里]】01、 图片优化器使用这个很棒的自动化脚本可以帮助把图像处理得更好你可以像在 Photoshop 中一样编辑它们。该脚本使用流行的是 Pillow 模块# Image Optimizing# pip install PillowimportPIL# CropingimPIL.Image.open(Image1.jpg)imim.crop((34,23,100,100))# ResizingimPIL.Image.open(Image1.jpg)imim.resize((50,50))# FlippingimPIL.Image.open(Image1.jpg)imim.transpose(PIL.Image.FLIP_LEFT_RIGHT)# RotatingimPIL.Image.open(Image1.jpg)imim.rotate(360)# CompressingimPIL.Image.open(Image1.jpg)im.save(Image1.jpg,optimizeTrue,quality90)# BluringimPIL.Image.open(Image1.jpg)imim.filter(PIL.ImageFilter.BLUR)# SharpeningimPIL.Image.open(Image1.jpg)imim.filter(PIL.ImageFilter.SHARPEN)# Set BrightnessimPIL.Image.open(Image1.jpg)imPIL.ImageEnhance.Brightness(im)imim.enhance(1.5)# Set ContrastimPIL.Image.open(Image1.jpg)imPIL.ImageEnhance.Contrast(im)imim.enhance(1.5)# Adding FiltersimPIL.Image.open(Image1.jpg)imPIL.ImageOps.grayscale(im)imPIL.ImageOps.invert(im)imPIL.ImageOps.posterize(im,4)# Savingim.save(Image1.jpg)02、视频优化器通过使用以下自动化脚本你不仅可以使用 Python 来优化视频还可以使用它来优化图像。该脚本使用 Moviepy 模块允许你修剪、添加音频、设置视频速度、添加 VFX 等等。# Video Optimizer# pip install moviepyimportmoviepy.editoraspyedit# Load the Videovideopyedit.VideoFileClip(vid.mp4)# Trimmingvid1video.subclip(0,10)vid2video.subclip(20,40)final_vidpyedit.concatenate_videoclips([vid1,vid2])# Speed up the videofinal_vidfinal_vid.speedx(2)# Adding Audio to the videoaudpyedit.AudioFileClip(bg.mp3)final_vidfinal_vid.set_audio(aud)# Reverse the Videofinal_vidfinal_vid.fx(pyedit.vfx.time_mirror)# Merge two videosvid1pyedit.VideoFileClip(vid1.mp4)vid2pyedit.VideoFileClip(vid2.mp4)final_vidpyedit.concatenate_videoclips([vid1,vid2])# Add VFX to Videovid1final_vid.fx(pyedit.vfx.mirror_x)vid2final_vid.fx(pyedit.vfx.invert_colors)final_vidpyedit.concatenate_videoclips([vid1,vid2])# Add Images to Videoimg1pyedit.ImageClip(img1.jpg)img2pyedit.ImageClip(img2.jpg)final_vidpyedit.concatenate_videoclips([img1,img2])# Save the videofinal_vid.write_videofile(final.mp4)03、PDF 转图片这个小型自动化脚本可以方便地获取整个 PDF 页面并将它们转换为图像。该脚本使用流行的 PyMuPDF 模块该模块以其 PDF 文本提取而闻名。# PDF to Images# pip install PyMuPDFimportfitzdefpdf_to_images(pdf_file):docfitz.open(pdf_file)forpindoc:pixp.get_pixmap()outputfpage{p.number}.pngpix.writePNG(output)pdf_to_images(test.pdf)04、获取 API 数据需要从数据库中获取 API 数据或需要向服务器发送 API 请求。那么这个自动化脚本对你来说是一个方便的工具。使用 Urllib3 模块可让你获取和发布 API 请求。# pip install urllib3importurllib3# Fetch API dataurlhttps://api.github.com/users/psf/reposhttpurllib3.PoolManager()responsehttp.request(GET,url)print(response.status)print(response.data)# Post API dataurlhttps://httpbin.org/posthttpurllib3.PoolManager()responsehttp.request(POST,url,fields{hello:world})print(response.status)05、电池指示灯这个方便的脚本可以让你设置你想要得到通知的电池百分比该脚本使用 Pyler 进行通知使用 Psutil 获取当前的电池百分比。# Battery Notifier# pip instal plyerfromplyerimportnotificationimportpsutilfromtimeimportsleepwhileTrue:batterypsutil.sensors_battery()lifebattery.percentiflife50:notification.notify(titleBattery Low,messagePlease connect to power source,timeout10)sleep(60)06、语法固定器厌倦了校对你的长文章或文本然后你可以试试这个自动化脚本它将扫描你的文本并纠正语法错误这个很棒的脚本使用 Happtransformer 模块这是一个机器学习模块经过训练可以修复文本中的语法错误。# Grammer Fixer# pip install happytransformerfromhappytransformerimportHappyTextToTextasHappyTTTfromhappytransformerimportTTSettingsdefGrammer_Fixer(Text):GrammerHappyTTT(T5,prithivida/grammar_error_correcter_v1)configTTSettings(do_sampleTrue,top_k10,max_length100)correctedGrammer.generate_text(Text,argsconfig)print(Corrected Text: ,corrected.text)TextThis is smple tet we how know thisGrammer_Fixer(Text)07、拼写修正这个很棒的脚本将帮助你纠正你的文本单词拼写错误。你可以在下面找到脚本将告诉你如何修复句子中的单个单词或多个单词。# Spell Fixer# pip install textblobfromtextblobimport*# Fixing Paragraph Spellsdeffix_paragraph_words(paragraph):sentenceTextBlob(paragraph)correctionsentence.correct()print(correction)# Fixing Words Spellsdeffix_word_spell(word):wordWord(word)correctionword.correct()print(correction)fix_paragraph_words(This is sammple tet!!)fix_word_spell(maangoo)08、08、互联网下载器你们可能使用下载软件从 Internet 下载照片或视频但现在你可以使用 Python IDM 模块创建自己的下载器。# Python Downloader# pip install internetdownloadmanagerimportinternetdownloadmanagerasidmdefDownloader(url,output):pydownloaderidm.Downloader(worker20,part_size1024*1024*10,resumableTrue,)pydownloader.download(url,output)Downloader(Link url,image.jpg)Downloader(Link url,video.mp4)09、获取世界新闻使用此自动化脚本让你随时了解每日世界新闻你可以使用任何语言从任何国家/地区获取新闻。这个 API 让你每天免费获取 50 篇新闻文章。# World News Fetcher# pip install requestsimportrequests ApiKeyYOUR_API_KEYurlhttps://api.worldnewsapi.com/search-news?texthurricaneapi-key{ApiKey}headers{Accept:application/json}responserequests.get(url,headersheaders)print(News: ,response.json())10、PySide2 GUI这个自动化脚本将帮助你使用 PySide2 Gui 模块创建你的 GUI 应用程序。你可以在下面找到开始开发体面的现代应用程序所需的每种方法。# PySide 2# pip install PySide2fromPySide6.QtWidgetsimport*fromPySide6.QtGuiimport*importsys appQApplication(sys.argv)windowQWidget()# Resize the Windowwindow.resize(500,500)# Set the Window Titlewindow.setWindowTitle(PySide2 Window)# Add ButtonsbuttonQPushButton(Click Me,window)button.move(200,200)# Add Label TextlabelQLabel(Hello Medium,window)label.move(200,150)# Add Input Boxinput_boxQLineEdit(window)input_box.move(200,250)print(input_box.text())# Add Radio Buttonsradio_buttonQRadioButton(Radio Button,window)radio_button.move(200,300)# Add CheckboxcheckboxQCheckBox(Checkbox,window)checkbox.move(200,350)# Add SlidersliderQSlider(window)slider.move(200,400)# Add Progress Barprogress_barQProgressBar(window)progress_bar.move(200,450)# Add ImageimageQLabel(window)image.setPixmap(QPixmap(image.png))# Add Message BoxmsgQMessageBox(window)msg.setText(Message Box)msg.setStandardButtons(QMessageBox.Ok|QMessageBox.Cancel)window.show()sys.exit(app.exec())总结最后希望你编程学习上不急不躁,按照计划有条不紊推进,把任何一件事做到极致,都是不容易的,加油,努力相信自己文末福利最后这里免费分享给大家一份Python全套学习资料希望能帮到那些不满现状想提升自己却又没有方向的朋友也可以和我一起来学习交流呀。包含编程资料、学习路线图、源代码、软件安装包等【点击这里】领取① Python所有方向的学习路线图清楚各个方向要学什么东西② 100多节Python课程视频涵盖必备基础、爬虫和数据分析③ 100多个Python实战案例学习不再是只会理论④ 华为出品独家Python漫画教程手机也能学习✅可以扫描下方二维码领取【保证100%免费】