Python Automation with ChatGPT

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 Be...
► ChatGPT Tutorial: • ChatGPT Tutorial - Use...
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: gitlab.com/nanuchi/python-aut...
► OpenAI API: platform.openai.com/docs/intr...
► Requests Python library: requests.readthedocs.io/en/la...
► BeautifulSoup library: 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 Be...
Full Docker course ► • Docker Tutorial for Be...
Full K8s course ► • Kubernetes Tutorial fo...
DevOps Tools explained ► bit.ly/2W9UEq6
▬▬▬▬▬▬ Connect with me 👋 ▬▬▬▬▬▬
Join private FB group ► bit.ly/32UVSZP
INSTAGRAM ► bit.ly/2F3LXYJ
TWITTER ► bit.ly/3i54PUB
LINKEDIN ► bit.ly/3hWOLVT
▬▬▬▬▬▬ Courses & Ebooks & Bootcamp 🚀 ▬▬▬▬▬▬
► Become a DevOps Engineer - full educational program 👉🏼 bit.ly/45mXaer
► High-Quality and Hands-On Courses 👉🏼 bit.ly/3BNS8Kv
► Kubernetes 101 - compact and easy-to-read ebook bundle 👉🏼 bit.ly/3Ozl28x

Пікірлер: 257

  • @TechWorldwithNana
    @TechWorldwithNana Жыл бұрын

    Hope this video was useful for you! 💡 Let me know in the comments, what use cases would you be interested in and generally what video topics you would like to see?

  • @MrMAhmed22

    @MrMAhmed22

    Жыл бұрын

    Bundle of thanks from pakistan Nana you're doing an amazing job

  • @andhojushiva6942

    @andhojushiva6942

    Жыл бұрын

    Please,make full video on DSA with python

  • @hasbldasbi8290

    @hasbldasbi8290

    Жыл бұрын

    It would be nice if you added it to the subtitles in Turkish😎⚙️🤓🤓🤓

  • @MAYANKKUMAR-pk3qo

    @MAYANKKUMAR-pk3qo

    Жыл бұрын

    Oops, too much annoying ads.

  • @JameelahTechWorld

    @JameelahTechWorld

    Жыл бұрын

    Hey Nana, thank you so much for creating amazing Peyton videos! I found this video very helpful. I am 10 years old. I just started learning how to call patients so I found your videos very helpful. I was wondering if you give tips for me? And also if you can mentor me?

  • @rushikeshdeshmukh385
    @rushikeshdeshmukh385 Жыл бұрын

    I got a job as DevOps engineer because of your KZread channel I am able to cleared 10 companies interview ...Thank you nana 👍😊😊

  • @m-jay356

    @m-jay356

    Жыл бұрын

    Wow!

  • @tsheskoelmaximus3784

    @tsheskoelmaximus3784

    Жыл бұрын

    One of the my satisfying comments/messages a teacher/instructor can receive. Thank You for being a Valuable Testimony of her efforts.🎉

  • @kadogo7712

    @kadogo7712

    Жыл бұрын

    that really encouraging for the wonderful nina .

  • @insurance5225

    @insurance5225

    Жыл бұрын

    What topics are required to be studied as I completed not getting how to implement projects some suggestions would be helpful

  • @leonardakubude5097

    @leonardakubude5097

    Жыл бұрын

    could you point the particular video that did the deed for you?

  • @Trumanshoww
    @Trumanshoww Жыл бұрын

    Hi, I am a man living in South Korea, and I am an AI researcher. My background is not at Computer Science, so I am afraid whether I can work as an engineer in the near future. However, thanks to you, not only this course, I am getting so much help from you. Thank you so so much for providing us this much nice-quality videos. I hope you always be happy. Have a great day, Nana :)

  • @valterpereiracjr
    @valterpereiracjr Жыл бұрын

    I was Clipper programmer (90´s) and tried to start learn Python (not very dedicated though) few times in the past. You did an amazing job explaining items like the "import" at the begining of the Python program and you did explain those in a very direct and clean way. I am truly amazed by your knowledge and the way you touched each and every line of the code you presented, even the one that AI created. Thank you a lot @TechWorldwithNana !!!! Great job!

  • @ScottKFraley

    @ScottKFraley

    Жыл бұрын

    Whooo Hooo!! Clipper in the Hizzy! ;D

  • @fromdil6470
    @fromdil6470 Жыл бұрын

    👋 I just wanted to take a moment to express my appreciation for the 👌 examples you use in your content to illustrate important concepts. In particular, I found your recent piece on how audiences can reach multiple outcomes 🤔 to be both interesting and informative. I hope you will continue to create more content like this in the future. Thank you for all your hard work and dedication to producing high-quality content for your audience. 😊 Best regards, Nana

  • @erichuang16
    @erichuang1610 ай бұрын

    I'm super happy to find Nana's channel. All videos that I've viewed are high quality -clear, logical and well explained. Thank you, Nana!

  • @mustafaezzi2871
    @mustafaezzi2871 Жыл бұрын

    Amazing. I dint expected a one hour video would teach such a valuable and real life project in such a easy way. Bow down to your excellence and expertise

  • @praveens2272
    @praveens2272 Жыл бұрын

    Awesome.. it definitely complement developers time but may not replace entirely

  • @hzupanc
    @hzupanc Жыл бұрын

    Thank you Nana for such an amazing and well-structured tutorial on how to get maximum from Chat GPT. It could give us a lot in everyday work to automate some boring manual tasks and in the meantime advance Python knowledge or some other language of your choice, dependable on our inputs.

  • @tba77
    @tba77 Жыл бұрын

    Great and interesting example, I learned a lot of things thanks to your channel I even managed to get CKA certification and have a goal to master python language which is the thing I lack mastering a programming language thank you for all the content you provide

  • @scottiepowell
    @scottiepowell Жыл бұрын

    Nana, fantastic video, love all your videos, anytime i'm struggling with a concept i check to see if you have a video on it. for the downloads cleanup i ran it for a windows 10 cleanup and it ran first time and worked but i told it 'cleanup files in the downloads folder', so chat wrote the script for files and didn't move folders in the downloads folder older than 30 days, i went back and changed the narrative and it worked like charm. The AI can be pretty sensitive to what we type and our words really matter in the results.

  • @RubenMoraVargas
    @RubenMoraVargas Жыл бұрын

    Great video! A small addition to the material: you can get the response of the GPT model in any language you need without a third party. You just need to add the specific instruction to the prompt, and maybe as a parameter in your API.

  • @paulrevere27
    @paulrevere27 Жыл бұрын

    great video! Thanks for your contributions to the dev community!!

  • @nagdali9209
    @nagdali9209 Жыл бұрын

    I want to say my skills improved in DevOps so fast, thanks to you. for this, its too informative as i expected from you🙂💥

  • @nilakshirekhawar2861
    @nilakshirekhawar2861 Жыл бұрын

    Hi Nana, I am working on Azure cloud revolving around its OpenAI offering for 5+ months, but learned a lot from this video :) thanks ! Keep posting good content like this

  • @daedalusjones4228
    @daedalusjones4228 Жыл бұрын

    I'm a technical writer. The way you work reminds me a lot of the way that I work. (I don't run into that often.) I mean the way that you explain things, the way you pause to explain the underlying (and transferable) concepts, etc., explain other options (and why you are going with the one that you choose)... Really excellent.

  • @spoorthipanduranga6220
    @spoorthipanduranga6220 Жыл бұрын

    It is mind blowing and very useful. Thanks for making this video. Please do the DSA python videos next!

  • @ahmmo2870
    @ahmmo2870 Жыл бұрын

    This is awesome! 👏 Thank you for making it! Would be great and appreciated if you can make a video on how to fine tune an OpenAI model 😊

  • @RealSiegrist
    @RealSiegrist Жыл бұрын

    Great presentation and great selection of examples. Thank you Nana!

  • @alkispiskas3580
    @alkispiskas35808 ай бұрын

    Excellent tutorial! Thank you for sharing!

  • @tarekhabibi3662
    @tarekhabibi3662 Жыл бұрын

    Awesome Automation examples , thank you 🙏

  • @djendjou1
    @djendjou15 ай бұрын

    Simple, but yet the most ingenious use (imo) of the openai api i've seen so far.

  • @saman6199
    @saman6199 Жыл бұрын

    Love your work Nana, thanks for the effort and interesting topic.

  • @EcleticMusicFilm
    @EcleticMusicFilm Жыл бұрын

    If I haven't commented yet, let me say that I've watched many of your videos and you're one of the best tech instructors out there!

  • @TechWorldwithNana

    @TechWorldwithNana

    Жыл бұрын

    Thanks so much, really happy to hear!

  • @elenaambrosino5171

    @elenaambrosino5171

    Жыл бұрын

    110% agree 😊

  • @adrienesquerre5790
    @adrienesquerre5790 Жыл бұрын

    Thank you for making it easier !

  • @lerryalexanderortizsalazar6069
    @lerryalexanderortizsalazar6069 Жыл бұрын

    Thank you so much! So helpful, and your explanation is amazing!

  • @sagarahire-ys3uj
    @sagarahire-ys3uj Жыл бұрын

    U r very well ahead of time...thanks for this

  • @sonachan1
    @sonachan1 Жыл бұрын

    Great video. Covered a lot of topics with an easy to understand style! Thanks!

  • @TechWorldwithNana

    @TechWorldwithNana

    Жыл бұрын

    Thank you Andy, so great to hear! :)

  • @ahassan7270
    @ahassan72705 ай бұрын

    You are a wonderful and SUPER teacher. I am very lucky found your channel. Python automation with chatgpt was a difficult and complicated issue before I found your channel. Your detailed explanations have melted all the difficulties and made things very easy to understand. Thank YOU so much for your great efforts and generous contributions which turned complexity into simplicity.

  • @BrandonVicedomini
    @BrandonVicedomini Жыл бұрын

    Excellent video Nana. Very useful video for Python automation and ChatGPT, I definitely learned a lot. I have a question for you. What tools are you using to create you videos? What do you use to create the animations and where do you get the graphics? Thanks so much for your content. Definitely a like and subscribe.

  • @magicmedia7950
    @magicmedia7950 Жыл бұрын

    By far the best explaination for API request I have come across. Thanks for the good work. You have a like and a new subscriber

  • @thomash.8297
    @thomash.8297 Жыл бұрын

    Top video Nana! Thank you so much!

  • @srinivasaraopalakaluri
    @srinivasaraopalakaluri Жыл бұрын

    I really impressed by your lovely way of explanation and pretty cool code !! :-)

  • @cardozoveronica
    @cardozoveronica7 ай бұрын

    Nana! I learned Python from you! thank you!!! At this point I'd like to know how to structure a complex python code, not in one file. Thank you again!

  • @OLAFBONDD
    @OLAFBONDD Жыл бұрын

    You have a talent in explaining. Thank you.

  • @hinafraz528
    @hinafraz528 Жыл бұрын

    you are amazing you start from very basic, love the way you teach.

  • @maryannsalva3462
    @maryannsalva3462Ай бұрын

    Superb! Thank you so much Nana! This is what all I need to start using OpenAI's ChatGPT! :)

  • @yt7042
    @yt7042 Жыл бұрын

    Thank you Nana. I will probably have to visit more often your channel. :-)

  • @brookster7772
    @brookster77727 ай бұрын

    Your videos are the best! I would like to request more videos on using the latest artificial intelligence related API’s perhaps even create some LLM apps, using python or another language, C-sharp would be great! Keep up the great work 😀

  • @AbuFaizal
    @AbuFaizal Жыл бұрын

    the way to teach concept explanation is excellent. please make more videos

  • @Unfaced85
    @Unfaced85 Жыл бұрын

    In my Company we have an AI/ChatGPT Hackathon later this month, so this video is perfect as preparation, thanks.

  • @tomkaufmann4390
    @tomkaufmann4390 Жыл бұрын

    great explanation, impressive results!

  • @christianmb1160
    @christianmb1160 Жыл бұрын

    Amazing Nana! Thank you so much!

  • @gammalgris2497
    @gammalgris2497 Жыл бұрын

    Interesting tutorial. I have to deal with complex software systems. There are two big issues I have to face constantly. Code and scripts don't get reviewed as much as I would like. Testing. Manual testing and inspection can be time consuming when done repeatedly. It doesn't matter where code or scripts come from (human or AI). If it's not reviewed and tested there is a problem in an ever changing system/ environment.

  • @stephanemoreau846
    @stephanemoreau846 Жыл бұрын

    Great job , it's a very creative video for multiple automation script and DevOps task

  • @mukeshtiwari87
    @mukeshtiwari87 Жыл бұрын

    great example. thanks for uploading

  • @mohamedheouaichi3392
    @mohamedheouaichi3392 Жыл бұрын

    Great Video and content. I like your videos and your lecture style. I also find your animations in your video very pleasing. Are using standart ppt animations or are you using a special software?

  • @TechWorldwithNana

    @TechWorldwithNana

    Жыл бұрын

    Thanks Mohamed! We use Screenflow

  • @drown228
    @drown2283 ай бұрын

    One of the best teachers I've ever known

  • @GlennLMS
    @GlennLMS Жыл бұрын

    Thanks for the video. Very interesting. One of the strengths of ChatGPT is the conversations, and how it remembers what has been previously talked about within the current conversation when coming up with new responses. Using the API, does ChatGPT still remember the conversation the Python program is having with it, or, is each API call a separate conversation? Hope that was clear 😋

  • @kinshuksinghania4289
    @kinshuksinghania4289 Жыл бұрын

    Wirklich fantastisch, Nana!!!

  • Жыл бұрын

    Hi, thank you for your content. I really appreciated it! I have an off-topic question: there is a place where can I found the images/resources/icons are you using in your videos?

  • @paulshortridge870
    @paulshortridge870 Жыл бұрын

    Fantastic demo thank you

  • @nirmesh44
    @nirmesh44 Жыл бұрын

    Super Useful.Great content.😀

  • @daedalusjones4228
    @daedalusjones4228 Жыл бұрын

    Really excellent. Somewhere around 16:02, you mention environment variables, and their purpose (not hard-coding your API key in anywhere). Exactly the kind of info I'm looking for. You're an excellent instructor. Great info. Thanks.

  • @bratwurstfan
    @bratwurstfan Жыл бұрын

    Thanks so much for the great introduction!

  • @minnuzamir5458
    @minnuzamir545811 ай бұрын

    really great you are my best teacher!!!

  • @aartikulkarni6761
    @aartikulkarni6761 Жыл бұрын

    Thank you Nana! Its very helpful !

  • @GereHadush
    @GereHadush Жыл бұрын

    It is great walk through lesson. Thank you

  • @eduhazard
    @eduhazard Жыл бұрын

    Thx!!! I Subscribed and liked! 🤩🤩🤩

  • @DJ-ct6so
    @DJ-ct6so7 ай бұрын

    Excellent presentation. I learned a lot. Many, many thanks Nana.

  • @OpenRoadTafreeh
    @OpenRoadTafreeh11 ай бұрын

    Simply Awesome! You are the best trainer

  • @mytechchannel2519
    @mytechchannel2519 Жыл бұрын

    Excellent content Nana, liked it

  • @nikolaysalutski3270
    @nikolaysalutski3270 Жыл бұрын

    fantastic video once more, thank you!

  • @GibranCastillo
    @GibranCastillo Жыл бұрын

    Nice!! Thank you for making this KZread video

  • @hanankevich5762
    @hanankevich5762 Жыл бұрын

    Awesome examples Can’t wait to adopt this chatgpt code generator in my work place.😅

  • @jsathyanarayana7782
    @jsathyanarayana7782 Жыл бұрын

    Awesome Video!!As always amazing graphics and very creative❤

  • @TechWorldwithNana

    @TechWorldwithNana

    Жыл бұрын

    Thank you Jayanth! :)

  • @khalifakane8835
    @khalifakane8835 Жыл бұрын

    Very useful. Thank you!

  • @SiddharthSinghFiery69
    @SiddharthSinghFiery69 Жыл бұрын

    Hiya Nana ! Great video. I had a small query. Is it possible to build a Slackbot (that's more like a chatbot) using ChatGPT and Python ?

  • @arielfranco8251
    @arielfranco82515 ай бұрын

    Thank you very much for all your amazining content!

  • @haidersyed6554
    @haidersyed6554 Жыл бұрын

    I love your teaching style, can you please make web development courses.

  • @romanhryshchenko9111
    @romanhryshchenko9111 Жыл бұрын

    Nana you are amazing! This is a great instrument to learn Python & automation for DevOps.

  • @zxcvbnm50748
    @zxcvbnm50748 Жыл бұрын

    Thanks Nana for sharing this awesome session.

  • @fehdiyadbenabbes7453
    @fehdiyadbenabbes7453 Жыл бұрын

    Thank you Nana this is one of my best channel

  • @musicalbirds2928
    @musicalbirds2928 Жыл бұрын

    Great video. Thanks for sharing.

  • @FRANKWHITE1996
    @FRANKWHITE1996 Жыл бұрын

    Thanks for sharing ❤

  • @charlesyaw6514
    @charlesyaw65145 ай бұрын

    Guys let's make Nana hit a million subs

  • @TechWorldwithNana

    @TechWorldwithNana

    5 ай бұрын

    :D

  • @salilphatak7792
    @salilphatak7792 Жыл бұрын

    Awesome example..!!

  • @SolomaZed
    @SolomaZed Жыл бұрын

    Thank you Nana, great stuff

  • @rus7289
    @rus7289 Жыл бұрын

    you are the best!

  • @nagarajabalur6374
    @nagarajabalur6374 Жыл бұрын

    very useful content. Thank you for sharing.

  • @ravireddy270
    @ravireddy270 Жыл бұрын

    Tqs for uploading

  • @kinandjeundja7130
    @kinandjeundja7130 Жыл бұрын

    Thank you Nana

  • @manohartimothy5825
    @manohartimothy58254 ай бұрын

    I got it... there was no space in the "Bearer "... I put the whole code into the chatgpt and ask fo the mistake...So I got the result from the chatgpt....Anyway your indroduction was amazing...thanks a lot for your tutorial.. I will be watching more from you Nana.. regards from Manohar

  • @thrivedhr164
    @thrivedhr164 Жыл бұрын

    Nice and easy to understand explanation, Thanks Nana

  • @TechWorldwithNana

    @TechWorldwithNana

    Жыл бұрын

    Glad to hear, thank you! :)

  • @WaltWhite_The_Walter_White
    @WaltWhite_The_Walter_White6 ай бұрын

    Very nice. Thank you.

  • @sonujain2348
    @sonujain23487 ай бұрын

    I m BE ECE 2012 pass out . Last 10 years I m LECTURE in reputeted institute . In college I learn c c++ n java but not interested in coding. Currently I started learning python.

  • @NetZeroEarth
    @NetZeroEarth3 ай бұрын

    Thank you Nana ❤

  • @m0rtyss
    @m0rtyss10 ай бұрын

    Hi Nana, thank you for sharing the knowledge . Just one question, you have teach python using PyCharm and now you are using VS, any reason for that??

  • @ananjohar8248
    @ananjohar8248 Жыл бұрын

    You are best tutor in youtube tech as a female version.

  • @NeverCodeAlone
    @NeverCodeAlone Жыл бұрын

    Very nice thx a lot.

  • @simcha_storch
    @simcha_storch Жыл бұрын

    Thanks Nana!

  • @anthonyrubio1194
    @anthonyrubio119410 ай бұрын

    Very helpful

  • @HemantMishra-pr9yv
    @HemantMishra-pr9yv11 ай бұрын

    thank you, thank you, thank you soooooo much Nana ma'am.

  • @allezvenga7617
    @allezvenga7617 Жыл бұрын

    Thanks for your sharing

  • @Ajeetkumar-uo4hf
    @Ajeetkumar-uo4hf Жыл бұрын

    Awesome

  • @PrachiHanuh
    @PrachiHanuh Жыл бұрын

    Amazing Nana, you are awesome.

  • @TechWorldwithNana

    @TechWorldwithNana

    Жыл бұрын

    Thanks so much! :)

  • @ovskihouse5278
    @ovskihouse52789 ай бұрын

    These tutorials... Especially make chatgpt One special

  • @fajobiafolabi4759
    @fajobiafolabi4759 Жыл бұрын

    Excellent video, Thank you so much. But have you heard of langchain? Would it make the code more efficient? Feedbacks thanks.

  • @manohartimothy5825
    @manohartimothy58254 ай бұрын

    Yes, I have a wish... Instead of printing on the terminal, can you do it on the local host...That will be very nice..thank you and have a great day...

  • @vaishalijain5854
    @vaishalijain5854 Жыл бұрын

    Thanks Nana for the awesome chatgpt automation video. Some issues I have encountered while executing this code in windows, I have mentioned solution for someone who is executing this code. 1. When opening html file for writing I got this error "UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f92f'" and fix was as below to include encoding. with open('spanish_headers.html', 'w', encoding="utf-8") as f 2. On windows, to set environment variable through terminal window in vscode, I had to use below command as export did not work $env:OPENAI_API_KEY= "keyvalue" Thanks