Python Automation with ChatGPT

Опубликовано: 29 Сентябрь 2024
на канале: TechWorld with Nana
274,979
6.3k

Python Automation with ChatGPT | Write Python code to connect to OpenAI API and generate automation scripts in seconds!

#python #chatgpt #techworldwithnana

▬▬▬▬▬▬ PRE-REQUISITES ⏰ ▬▬▬▬▬▬
► Python Programming Tutorial:    • Python Tutorial for Beginners - Learn...  
► ChatGPT Tutorial:    • ChatGPT Tutorial - Use ChatGPT for De...  

In this video we are going to learn how to use Python to automate things for us so we don't have to do them manually. We're going to automate 2 use cases:
First we will write a Python program that takes any blog article or any web page and it extracts
all the headers from that page or article and then it translates all those headers to Spanish and saves it into its own HTML file so you can open it in the browser and basically see all the headers of that specific blog article translated in Spanish.
In the second use will be that we're going to write a Python program that goes through all the files in our downloads folder it then checks if we have any files that are older than 30 days or were last used
more than 30 days ago and it takes all these files and puts that into a new folder called "to_delete" which we can then review and basically delete if needed. So basically it helps us clean up our messy downloads folder with a bunch of old downloaded files in there.

But here's even more interesting thing we will do we will use an artificial intelligence tool that you probably have already heard of a million times called ChatGPT and we will tell Python to use
ChatGPT's API or the underlying API that ChatGPT is also using to generate the Python scripts for those two use cases that I mentioned.


▬▬▬▬▬▬ L I N K S 🔗 ▬▬▬▬▬▬
► Git Repo for this tutorial: https://gitlab.com/nanuchi/python-aut...
► OpenAI API: https://platform.openai.com/docs/intr...
► Requests Python library: https://requests.readthedocs.io/en/la...
► BeautifulSoup library: https://www.crummy.com/software/Beaut...


▬▬▬▬▬▬ T I M E S T A M P S ⏰ ▬▬▬▬▬▬
0:00 - Intro - What we are automating?
02:37 - Why Python for Automation?
04:39 - Connect to OpenAI API
06:45 - Create account and API key
08:07 - Pre-Requisites for demo
09:15 - Write Python script to connect to OpenAI
33:29 - Install Library
35:17 - Execute Python Script
40:15 - Accept Prompt Input to send to OpenAI
53:11 - UC 1: Python Automation Script for Blog Post Translation
1:08:01 - UC 2: Python Automation Script for Cleaning Downloads Folder


▬▬▬▬▬▬ Want to learn more? 🚀 ▬▬▬▬▬▬
Full Python course ►    • Python Tutorial for Beginners - Learn...  
Full Docker course ►    • Docker Tutorial for Beginners [FULL C...  
Full K8s course ►    • Kubernetes Tutorial for Beginners [FU...  
DevOps Tools explained ► https://bit.ly/2W9UEq6


▬▬▬▬▬▬ Connect with me 👋 ▬▬▬▬▬▬
Join private FB group ► https://bit.ly/32UVSZP
INSTAGRAM ► https://bit.ly/2F3LXYJ
TWITTER ► https://bit.ly/3i54PUB
LINKEDIN ► https://bit.ly/3hWOLVT


▬▬▬▬▬▬ Courses & Ebooks & Bootcamp 🚀 ▬▬▬▬▬▬
► Become a DevOps Engineer - full educational program 👉🏼 https://bit.ly/45mXaer
► High-Quality and Hands-On Courses 👉🏼 https://bit.ly/3BNS8Kv
► Kubernetes 101 - compact and easy-to-read ebook bundle 👉🏼 https://bit.ly/3Ozl28x