 Hello and welcome everyone and welcome to my new course on Google barred for programmers So in this course, we are mainly focusing upon how bar can help us from the programming perspective Now before we dive into let's just get in a little overview about what this Google barred is So we already know that Google has released their large language model for the conversational like chatbot kind of system and I have already experienced it. It's one of the most amazing advanced chatbot system currently available and Currently I am at home page of this Google bar. So I am at a bar.google.com. So if you want to access this Google bar system, you have to have a Google login in my case. I have already logged in with this Let me just go to incognito Window and if I just try for Google I mean bar.google.com oops Okay, something goes wrong bar bar bar dot Google.com All right. So if you have not logged in you have to first time sign up into it And still this bar is in a experimental phase. So I have already logged in with my Google account So I am inside the bar Now, let's just get an overview about the complete interface. So for the programmer We are gonna use so Google has released recently a two team I mean one is by default this white team. There will be one more like a dark team so if you want to change this dark team on the bottom left corner you will be able to see you can Navigate to or switch to your dark team and I just love this dark team So I'm just gonna switch to dark team and throughout this whole course. I'm gonna use this dark team alone Okay, on the left hand side, you can have a look at You can reset your check whatever conversation you are doing with this bar and a completely new conversation You can start it There is a bar activity. So whatever search or a conversation happens With a bar that will be monitored here. There are some FAQs whatever help and updates Google will do about the bar. You will be able to monitor from here. So about FAQ it will redirect you some other page How to use bar and everything as far as updates are concerned In a timeline basis, whatever updates Google will do it will put it here Okay, so that is a very simple nice interface, but keep in mind that bar is still in experimental phase More and more Google says that you check with bar it will improve your experience Okay, so I think we are good to go ahead. So very first thing is about this particular course So we are going to focus upon how to create this Python application With the help of bar. So how bar can help us to quickly generate a Python code To build a simple Python application and how we are going to do it So first thing is we should know about the Python That means I'm not expecting that you completely know about the Python But I am expecting that at least you have a basic idea about what Python is as a programming language How people generally course in a Python So there are two things on our local environment we require So if you don't know about the Python simply write in your prompt What is Python? Okay, let's just go ahead and just press enter Now here you can give your input with the help of microphone also as a speech input also So Python is a high level general purpose programming language And there are a lot of details about the Python and they have given us If you don't like any generated answer you can just simply go to Viewing some other drafts also by default with every single answer I have observed that there are three different drafts being created Alright, so that is about the Python programming language Now next thing is how to install this Python in your local machine And apart from this installation of Python what are the code editor we are going to use So let me just put here what are code editor for Python Now not necessary that some particular one which I am going to use in this course You have to use this one You are always free to use any of the code editor throughout this whole course So you can have a look at we have PyCharm, Visual Studio Core, Subline Tags Atom And we have Jupyter Notebook So I am going to use this Visual Studio Code on my local machine So there are three, I mean two installations where we need to focus upon to set up our environment So very first thing we require Python in our local machine And the next thing is Visual Studio Core should be ready in our local machine So both of these installations we are going to see in the next video And we will just simply getting started with a printing simple hello world And make our environment set up so that in future whatever code will be generated by this bar Will help us to build our next Python application Alright everyone, that's all about this video and I'll catch you in the next one Alright everyone, so in this video we will see how to install this Python And afterwards a Visual Studio Code as editor Once again I am telling you that you are always free to use any other code editor for your Python program Alright everyone, so very first thing is Python installation So let me just write here itself on a bar prompt like Python installation Staps, very simple steps we are going to follow We want to dive into developing a very high level any Python framework or anything Just simple Python So what this is that go to your Python official website download page Choose the version of Python you want to install Click the download run installer and follow on screen instruction And that's a very very simple thing So I'll just go through those steps fast Although this Python is already installed on my local machine Alright, so installation of Python Okay, and okay I have to go to official website of Python So download Python from this Python.org And currently as of recording this video The version the latest version of Python which is available 3.11 But I am not going to continue with this 3.11 You can just simply download one of them Now this is a very simple installation So I'll just okay I mean go ahead from here And I'll show you if I just open simple command line prompt on my Windows machine Just type Python after installation It will redirect me to the Python prompt And this indicates that Python is working fine on my machine With the Python 3.9.13 version Now as far as our codes are concerned This is good enough for us to get started Okay, so that is one thing Another thing is for code editor we require Visu Studio Code Studio Code Okay, and Visu Studio Code also downloaded a link You can get it from here Now depending on which operating system you're working upon You can download its respective version In my case it's a Windows And that is also being installed The installation process is quite simple and straightforward So let me just go to Visu Studio Code Which is already installed Let me open it Alright So I'm inside my Visu Studio Code And there are a lot of customization I have done And I just love this dark theme So I just change this dark theme You can do all those changes and everything here Now on the bottom side You will be able to see I get the complete prompt But I'm not going to use this PowerShell Instead of that simple command line we are going to use Okay, now very first thing is I have to create a let's say New folder So let me create a new folder Inside which we are going to keep all our code So and that is just simply open folder Is there anything like creating new folders or something like that Okay, let me open it So what I'm going to do Let me go to some other place in the documents I'm just going to create a barred Python So where we are going to keep all our code Okay So that will become like our workspace Inside that let me create a simple Python code Without taking any help from Let's say From barred Okay, let me create sample.py file Let's say very simple I just want to make sure that I'm in Python With barred Okay And let me save it How I'm going to run So is there any way directly to run in an interactive window? That's fine Run this Python file in a terminal Select your Python interpreter So which Python interpreter you want to use it So currently I have a multiple Python interpreters are available And one of them is Anaconda Python EXE also available Selected a workspace level That's better So I have a 3.9.13 which I'm going to use it Okay Is it been running? Let me run once again Ah, yeah It has been successfully executed And you can have a look at There is some typo here About the Python Okay Let me run it again Run Python file in a terminal Yeah So we got this output See I can just directly use it Something like I can open Here the terminal Yeah, open an integrated terminal So I'll be land up to this particular place in a bar Python And I can just simply use like a sample Py And you can have a look at We got this Python with bar as an output So that means that our ID is ready Python has been successfully installed And we are simply able to run A very simple hello world kind of print statement So everything is running fine Now the next thing is we need to build a Python application But where we are going to heavily use this bar To generate a code for us So that's all about this video And I'll catch you in the next one We'll just straight away dive into Bar code generation about the Python Okay Hey everyone, welcome back So the very first application Which we are going to create With the help of bar for our Python application That will be let's say a very simple one Let's say we want bar to generate a code For generating some random number Okay, let's see how bar can help us Now before bar does anything Let me just reset the chat and we'll just start a fresh one A new chat conversation with bar For generating our Python code Let's say a very simple prompt I'm just going to give like a write Python code to generate Random number A very simple one Or let's say number All right So you can have a look at multiple drafts But looks like everything is little same Will improve upon all those code So they are using some random modules And a random kind of function to generate some number Okay, there are other also code being generated So there are two codes it has generated for us One is listing 10 random numbers Let's just go with the very first one Okay, if you want to copy the code Don't try to do like this They have given a very nice shortcut To copy your complete code Let me go to my Vizio studio And instead, I mean let me create a new one Let's say new file random.py Okay, that might create some problem Because the module name is also random So let me rename it My random Okay, that's good Okay, so with command says that It's going to generate some random number Between 1 and 10 Let me just Can I do everything on a command prompt Tax better for me Yeah Okay, is there any way to make fonts little bigger here The command line fonts That's fine Okay, let me just go with Python Let's say my random.py Let's see what it will generate Oops, it has not generated anything Surprise Oh, I haven't saved this file I guess Yes, it has generated three Seven But you can have a look at it Just keep generating between 1 and 10 only Can we improve upon this particular code So let's say we'll just give instruction Let's say we'll just give instruction to the bar That generate or generate some code Which will like accept some input Like a minimum number and maximum number Okay I mean, rather than generating always between 1 and 10 So can you Can you accept input in above Code like a max and mean Okay, let's see All right Good job so far And you can have a look at Now the code has been generated will be Something like it is accepting a minimum and maximum And between min and max it will I mean, generate some random number So let's try it Now instead of this one, I'm just gonna go with this Okay And let's let me just simply save it And let's run Okay, now I think the fonts looks very small So what I'm thinking that we can we can try to run Same thing on my command line That's better on command line Let me go to this particular location Okay, now I can try with like a python And my file name will be myrandom.py All right So you're asking for what is the minimum value Let's say 45 maximum value Let's say some 98 So it should generate some random number between this Yeah, so far so good It has done a good job Let's say between 10 and 25 Yes, 20 it has generated So far so good Okay, so can we again improve upon it or something like What will improve So instead of just a random number Can you generate some float values also Okay, okay We haven't tried with any negative number Okay, before that So let me just try with negative stuff Okay, let's say I'll just give something like a minus five Okay minus 50 Let's try it And let's say minus seven Okay, good job So it works for negative number also So no way to improve for negative number But we can improve for decimal number also Because it is generating the values for just integer only So we can just simply ask but Can you Generate Code to Code Generate a code to generate Random Decimal number Also in above code Okay, let's see So this way you can keep giving prompt and keep on Improving upon your existing code Okay, so now it has not used this Rendint instead of that it has used this uniform function So let me just copy and let me try it Okay, let me call up this complete terminal Which I am not going to use it Okay, now it's going to generate this random stuff I mean to say the random decimal number Let me try it Okay, enter minimum Let's say I'll just give one thing like let's say 10 And let's say something like 30 And it has generated 26 Okay, that is okay, it has not been saved actually I should save it Okay, let's 10 Let's say 13 Yeah, great job 15.08 So it has generated like a decimal value Okay, and it has done a nice job also So so far we have given the range Like in input as a integer Like a 10 and 30 Let's say I can I try to give something like let's say 5.5 and let's say 6.05 Yes, great job So it works for both like integer also and for float also Okay, so so far so good Can we improve upon it? Let I would like you to think actually And for this video I'm just going to end And just think over what you can improve What you can ask to the bar And how you can take a help from bar In the next video we'll just continue I hate from here to improve upon it Alright everyone So let's just continue our discussion on a random number generation python code Okay, so so far it is able to handle this float and integer boat But somehow let's say while giving input Some user give like a string as a input Which is not a desired input Okay, so what happens that Let's just try with the python I mean from the python terminal only So here I'm just going to give input Let's say something like a T Immediately I got error So what I can try to do Now I can just even ask to bar itself That try to correct this one Okay, so let me just copy the correct error I got this error while running the above code This kind of prompt I can give I got below error Oops While running above code Can you handle same error in above code Okay, so that is the value error Alright, so you can have a look at It has improved upon our code And it just try to catch any value error Happens So let me copy this one And let just simply put it in our python file So code is getting bigger But it's just try to handle a lot of other stuffs also So my end up Now I'm going to give input Let's say something like let's say nine So that is definitely accepted But with some alphabet What it says that Name error the max value is not defined So again we got some error So max value is not defined Definitely it didn't get an It just create some exception But even after exception creation It has not handle something at this location So now rather than thinking much about it Let's just copy This part And provide it to your bar Again got below error Always type error Okay, let's see how it will handle it Okay, so for mean value Max value Okay, okay This code will now work without any error You can test it by running in your python interpreter So I know that definitely it's not going to work it The reason is that now this is the place Bar is failing I guess You are correct The max value variable is not defined I think I haven't given The complete one Okay, I should have written something like Again got the below error in above code Actually not some random code Let's see So I think the prompt was not correct No, no, you are correct No, no, it's not able to handle this thing Okay Okay, what kind of prompts now we will give So that it will handle this string stuff also And it will not Actually it should not throw error Instead of that it should say something like Mean and max is not defined So what errors will get Okay, so let me do one thing Let me just copy the complete one And I'm just going to give it like Not in above code So I have to change it here only Got error in this The complete one Let's see Okay, not able to produce So this is where its intelligence are lacking But that's I guess perfectly fine, I guess Okay, let me just write it like a max underscore value variable For for max underscore value variable Please handle exception also And rewrite complete code So it will give me again back to our original code, I guess Yes, okay, okay So there is one more thing it is trying to handle That maximum value must be greater than or equal to your minimum value If it is not definitely it should create a problem But I think it has I mean handled this exception at this particular level I was expecting that Bard will handle some exception at this particular level Okay, so if the mean value or a max value is not defined Don't generate it Okay, we can give such a kind of input also Let's see whether it is able to code inside or above code or not If min or max not defined Don't generate number Include in above code So now you can have a look at the lot of problems we are writing We are just keep asking We are keep taking help from the Bard and improving upon our code All right, see what happened Yeah, so now it looks a little fantastic The minimum value is none or maximum value is none The minimum value must be defined If it is not, you cannot go ahead Okay, that's fine Let me just copy that is the quite improved version of earlier what it has created So let me put it here Let me save it And now I'm just going to run it once again Let's say I'll just go ahead and say seven and maybe let's say you So invalid input, please enter a valid number The minimum and maximum value must be defined So that is the fantastic job Almost every single thing, I mean, you just try to cover up But let's just do with the very simple Let's say eight and something like a 9.5 Great job Has done If I just try for let's say Some minimum number, I'll just make it bigger And maximum number, let's say 50 So maximum value must be greater than or equal to minimum value So a lot of corner case, it just try to handle over it So nice job I mean, Google Bard has done nice job But you can see every single moment Whatever you want to introduce in your application You can just keep giving up proper instruction And it will generate a code for you Okay now what should be the possible next step We have seen that the moment we get some error You can just paste those error It will try to interpret those error And see I mean what new code it will generate Okay, so the next step what we can go ahead Like we can just try to convert the same code For the random generation into our kind of web application So we'll see that part in the next one Here everyone welcome back So in the last video I told you that we'll just try to wrap this code Into kind of web application Rather than a simple command line based application I mean this Python one But I thought that let's do little bit more mysterious stuff Like this is the complete plain code So we want to refactor this code Into kind of let's say function So that in future we can just simply use this as a function So can bar help us to refactor this code into a function Let's just try with that So I'll just give a simple prompt Like refactor above code Let's see what it will generate If not we'll just try to add something else Okay great It has refactored every single thing Into you can see two different functions Okay third different functions Too much So nice job of refactoring actually So get min max values And it is asking from the user And it just keep asking See it has added this while loop also But let's say you don't know I mean What is happening with this particular code So we'll see We can even ask for some kind of explanation also from the bar But let's just keep it as it is Let me copy the complete one And we'll just put it into our editor So that is completely refactored version of our code And now let me run All right minimum value Let's say 5.5 Something like 9 Great job so far So everything has been refactored Let me try with some other bad number Let's say P Invalid input Please provide I mean please enter a valid number That means unless and until you do not give the proper I mean integer or float value It just keep asking See so that is one more addition it has done Okay so far so good So that is like a Refactoring of your code Now the next thing is what we can do Let's say this particular part I don't understand about the code I can just simply copy Please give me the proper explanation of the below code I can just try like this Please give me Explanation of below code Okay so what is the interpretation Let's say I don't understand what is going on Let's see how bar can help us Okay so what it says that sure The code you provided is in a wild loop So that will continue to run until The mean value variable is not null So as far as the mean value I mean variable is none It will just keep asking stuff from us The first thing the loop does is to try to convert the input from user to float If the user is not giving any valid number The value error exception will be raised And the print statement will be executed That's fantastic job So this way you can ask for some kind of help from the user also Let's see what other things we can do And afterwards we'll just go ahead And convert this code into kind of I would say into web application Yeah web application Okay is there any other thing I can Yeah here they have given a proper nice documentation Also this particular function But I can just ask for Generate some documentation at every single line I can just ask for like this Generate documentation Okay generate comment comment Let's better comment For every line inside the code Every line of above code Okay let's see Now I'm not sure above code means Which code it will take into consideration It has taken into consideration this particular code And that's also fine See for while mean value is none It has given the explanation for it For try also it has given the explanation And for accept block also it has given this explanation That means the nice part I mean nice thing it has done like a commenting every single line So the other developer can easily understand about it All right everyone So I guess we are I mean we have done enough experiment Now in the next video definitely We'll just convert the same thing into a kind of web application And for that we are going to use this flask web framework All right everyone welcome back So in the last few videos We created a command line based Python application But now we want to use the same code And convert it into Python based flask application Okay so what we'll give like instead of giving Oh okay first of all what are the different frameworks Are available for web So what are in different Framework available in Python for web Okay let me correct it Although you don't worry about it I mean Bard will take care So what are different frameworks are available in a Python for web So we are going to use the flask And that is one of the very simplest easy to use framework You can see it has given the nice list of features That which are the famous framework For Python when you want to build a web application All right so some description about the Python Python flask is a micro framework That is known for its simplicity and flexibility It is a good choice for small and simple projects All right so that is good to go ahead now So very first thing is let's just go for here And it has nicely done this code So what I'm going to do Let me just copy the complete code And I'm just going to reset this chat I don't want anything of I mean From the earlier prompt we have written The output from the earlier prompts So what I'm giving as a prompt like a generate Python flask based Web application for below code Now I have a code the very business logic I have Let's see how it will help us to generate it So I'm just going to put the complete code here And let's see Now there are always limitation in your prompt bar Oops okay okay The output is at the back end Okay so it has generated two stuff And it is asking see as input Minimum value also maximum value also And in output it will generate this random decibel Now how we are going to put it How we are going to run this Let's say we don't know anything So very simple thing what we can do Let me just copy the very first code And I'm just going to wrap it in this particular code There are multiple drafts also There is no point to even see the other drafts But still you can see it has generated another routes also And in a third draft similar way on a similar line Okay I can go ahead with the third draft And we can just simply run this Python app.py But I think here there is no HTML stuff Okay we can go ahead and later we can Okay it has HTML See it has HTML But I don't find any HTML here See HTML in the sense that it is just rendering this index.html file But there is no index.html it has generated Let's just take any one of the code See here also there is no index.html I want to go ahead with the index.html There are multiple files Now we are going to deal with the multiple files So what I can try with that Like Let me copy this code And I'm just going to put this code into Let's say another folder Let's say folder will be like a random Web app Okay and let me Close every single thing Now here I'm just going to create Main.py Let me put the complete code here Okay don't worry we'll just improve upon all those code Now flask is a web framework that is external to our body library So if it is not installed you have to install in your local machine Now in my case it's already installed But if you want to install you can just simply use Something like a pip install flask Now if you don't get how to install it Just simply use bar that how to install this flask framework Okay so that is the one thing Now apart from this thing I have to put this html code also So let me just keep it this html code And I'm just going to use another file like index.html Let me keep it here Okay how we are going to run it So does bar has given any kind of instruction to run When the web application is running You can visit to this particular URL And you can check for it Okay So I can just simply go here Let me just do cls I have created another folder like a random web app And from here we are just simply going to run app.org Okay not app main.py And it just started running Okay so I can just visit to this particular URL And let me go to my browser and check for Yeah it's still rendering So I guess something goes wrong Okay it is asking this enter minimum value here Okay that is not a expected thing It should take this input from the web UI Don't worry we'll just try to correct this code Let's say I'll just give here 5 Let's say 10 Okay I got error Too much error So what are the issues And all those issues we are going to fix with the bar Okay So one thing I can try with this Randomly I can just simply paste the complete code In Google bar And it will I mean I'll just tell that what is going wrong here See name error Random is not defined What it says that random is not defined So in that particular case You can just simply ask to the bar And it's not a very difficult I mean difficult error or anything So I can just simply use like a import random Okay that's good enough And the next thing is Let me just run this once again Okay it just started running And oops oops yeah So enter minimum value let's say 5 Let's say 10 And again I got error Okay So now the next thing is a Ginger exception Template not found error Okay let me copy it and put it into bar Correct Error In About Code Let's see what it will tell us All right So error says is raised because the Flaps Application cannot find the template file index.actyml But we have created this index.actyml What they are saying that for example If the index.html template file is located in template Directly you can create a fast application as follows So you have to use this like Whatever And once you have fixed error You can be able to run this application So let's see in our code What is the stuff We haven't provided anything like a templates But this thing I have kept it inside I mean the root folder of our application So what I can try I can create a new folder like a templates And let me move this index.html inside it So now index.html is a part of this templates folder And next thing is I can just simply run once again Let's see Whether we get some error or not 5 Let's say Let's say 10 And bang on See it has generated this random number But it is asking from this input also So minimum let's say I can give here 10 also 20 But why then it is asking from the command line See between 10 and 20 Okay matter is not allowed for the request URL So there are a lot of glitch in this particular code So where this particular error occurred The matter is not allowed Index.html Okay what I can try that Don't ask input from the command line in above code I can just write And I will ask for rewriting the complete code So don't ask min and max from command line Grab input from web ui only And regenerate the code Let's see whether it will be able to come up with a new code or not Yes See some change it has done Okay I can I will try for this code And we'll just try to change both of them So let me copy this one And I'll just go now Change the complete one And that's beauty here No need to think much Just simply change Whether this is the same code or not I'm not sure So for that I can just simply copy Hopefully it is the same code I guess HTML part it has not changed anything So let me do it here Okay I think earlier it used to send a post request Now it's gonna be a get request That's fine I guess And now I can come here And let me run it Oops Matter not allowed what it says that Ah yeah it's running So I can just give the input here only let's say 10 20 Oops again this random is not defined I can just simply give it here Random is not defined in above code So every time bar is forget to keep this random here Definitely I mean it's just so simple You just need to import it But I'm just want to know how bar can handle it So bar it says that you have to use this import random And it has rewritten the complete code also But don't worry I'm just going to change this random part only And let me keep it inside Main.py Save it And now again we are going to change Stuff Oops oops oops let me just go ahead like this Okay let's say 7 Let's say 10 Oops So now unsupported operand type string string So where this error occurs It is I mean we haven't given any kind of String input or anything even if it is not able to handle that's fine So what is the issue So what happens that it is not able to I mean it is not trying to Type cast into other variable like integer and float And that's what the missing in this particular case And this error we have solved multiple times So what we'll do we'll just end this video And we'll try to correct the same error in the next one Or write everyone so in the last video we get this particular error So I'm just going to copy this one And hopefully it should be able to handle this Unsupported operand type error So I got this error In above code So can you rewrite the code by handling those string input also Oops oops oops oops I have to give the proper one Okay So they have given the nice one But got this error in my web app code Can you correct it Now let's see whether it is able to understand the earlier code In which it needs to correct it or not Still not see The above means it just simply above So what we can do Got this error in below my web app code And here I'm just going to paste the complete code Let's see Let me update it So hopefully now it should be able to generate the correct one See no no no See what it says the error says that unsupported operand type Occurs in your code Because you are trying to subtract To string Function returns a float So you need to convert the string to float before something But where you are helping me to convert No, it's not helping me to convert Okay What What I can try I got Some change in a prompt Got this error in a below web app code Can you rewrite the code for me Let's see Okay still not So okay okay here But it is able to handle this integer only Let's just keep it as it is Because we know that you can handle with float also And earlier also many times we have done So EI is able to understand a lot of things But there are a lot of inputs also You need to give based on your requirement Okay So I can go to my visit studio code Let me Put the code here Okay Next thing is let me run it Okay Let's say 4 Let's say 9 Great It has generated this random But definitely it's not going to work for let's say 10.5 Let's say 50.25 Okay 5.2 Okay definitely it's not going to generate invalid int Okay that's perfectly fine We know that how to tackle this issue For now I'm not going to go ahead You can keep asking for the prompts And you can update this app Now the next thing what we can do with this web app Like generate some little better and beautiful UI for us So we'll just try to embed some CSS Into our web application All right everyone So we have created our application And that looks like a very simple application Now rather than embedding something related to Python code To add some more functionality Let's just try to beautify it with the help of adding some CSS code So what we can do in our same Jet conversation We can say like Can you Add A Some CSS To Beautify Above Web App And Give me both HTML And CSS code With Directory Okay with the directory Structure Okay Okay, let's see And we'll just try to embed whatever code will be generated inside our actual code All right So you can see this is the HTML code It has given us with the reference to style seat So this is the one HTML I'm just going to put it here Okay And there is one more like a CSS code To beautify our web page Style.css Okay, now what they are saying that directory structure has to be something like this For this index.html and style.css But I want this directory structure for For flask Web app Not for this index.html and style.css Okay So what they are saying that just like earlier The way we have created template contain index.html Same way one can create I guess CSS and inside the CSS we can keep like a style.css So there are multiple structures are possible I mean in case of flask web application So you can use something like this also see In a template we kept index.html In a parallel we have I mean kept this main.py file also Same way I can create a static folder and inside the static I have a CSS Okay inside the CSS I can keep like Or I can just directly keep style.css I guess in a static Let's see how it goes So static style.css Okay And style.css code we need to copy it Okay lot of description about the complete Code they have given Okay not this directory structure I am interested in this code Okay I think we are good to go ahead and We can just simply navigate to our web application Okay let me refresh it Now much change I guess So I can try to reload the complete page Okay is there any CSS being loaded or not how I can make sure One thing I can just simply do like a restart the server That means exit the application and let me just start this app again Let me Okay sometimes there are a lot of caching stuff So let me just go and check for viewing page source Okay style.css is unable to I mean fetch it So I think our directory structure is not a correct one Okay so where it exists so it exists inside this CSS Can I access this one? No no okay not CSS this is like a static Yeah so it is able to access with this particular way So what I can try I mean in one of the suggestions they have given Like in a static I can create another folder Let's say CSS and inside the CSS I can keep this style Now why there are some standard way to keep this like this You can definitely configure it via your main.py file Lot of things but there are some standard way to keep all those things Let me refresh once again Now can I access this CSS Yeah CSS can be accessed but whether my web app is able to access it or not I'm not sure Okay let me just view page source Oops so I'm not able to access the CSS I don't know where to place it So I can write like I am not able to access CSS Where should I place it in flask web All right so what this is that you have to write like this actually Okay and I can go ahead So in index.html also there are some modifications I have to change it Because now we are accessing like this Okay and now I can try to access the same application Yes little better See between 10 and 20 Oops but apps are not running apps are not running So let's see is there any error No this web app generates the random decimal number Let's say 7 and 20 Okay so it's not able to generate it If any error it is being displaying or not not sure Okay what I can try like let me restart the complete server First ever thing is whether it's able to access this CSS I'm sure it is able to access it Yeah see But that's fine actually it should be Is there any change we have done in this main.py file I guess not and get is also fine Okay so there are some change happens here and It is returning this random decimal So we should try to I mean display this thing here But in our code the html code looks weird actually So html code it has changed See if I just try to see this html code it has displayed Is like a span random decimal id and that's what I don't want So now please correct this part in above web application Below are in index.html while displaying random number Yes okay some JavaScript stuff it has given us Like okay I should have I should kept it a complete code actually Okay it has given like a when you click on on I mean generate random number So it's always better not to copy always every single thing because sometimes it does Changes some of I mean some other stuff also Okay, so we can go back and you can see We have something like this random number being generated will be something like so I can try with this one Because we are already returning the same stuff So after this prompt I mean form I can use like this and Let me refresh. Yeah. See now it should work. Hopefully Yeah, okay, we haven't given any input. So that's why this is the error, but that's fine Okay, uh, do you want to change anything in a CSS? Let's just try with that Okay, see in in above CSS code I mean generate Button I want it Smaller and Some other Nice color Let's see Okay, so it has generated like this actually but we are expecting that It should generate the button with Whatever code we have supplied. So you just always try to forget Whatever earlier code we have I mean provided. So what I can try like In above and below code Okay, I can change it here on the In Below CSS code generate a button CSS I want it smaller and some other nice color Okay, okay Some change it has done. Okay, we can try to experiment it No change Okay, CSS needs to be reloaded. I guess so for that I can Okay, is it updated one? I guess not So as a developer I knew that I can just clear the cache From the source See this CSS I can delete it or I can Okay, let me just Access the same web application in another Incognito mode. Yeah, see the green color it has generated That is just because of caching and I need a smaller this generate button And it has nicely done this thing also All right, so that is about the web application, but there are a lot of goofs of this part has done While generating this code, but that's perfectly fine. You provide the proper prompt that in this particular code only I need to have some change every single time I didn't provide any code and I just keep doing like above code just change something in above code It's just referring to some other code or some randomly Generated some earlier codes. Okay, so that's where some mistakes are going on. Okay So that's all about this video and I'll catch you in the next one All right, everyone. So in the last few videos, we created this random generation web application And there are a lot of prompts we have written here now I know that there are many times we have gone here and there just corrected code given some more instruction Can we write all those instructions together? I mean whatever we want and we'll just keep telling Bar that update this code afterwards because whole our directory structure and everything has been set up So let's go ahead with like let's say generate Let's say generate Okay, instead of generating this random number application, which we have already done Let's just try with some other application. Let's say generate a web application In python flask Flask like to do any job. Let's say What it will generate let's say find a square root of any number Number will give more instruction Okay, generate python code and handle negative number Also Get input From web UI text box Generate some nice Looking HTML and CSS code also Now we know complete directory structure. So similar way another application will just generate. Let's see what it will generate for us Okay, so very first thing is a python code Find a square root Yeah, it is the html code Okay, so what I can try I can just quickly go to My visu studio code. Let me close all those stuff and Inside this same bar python. I'm just going to create a new folder that is like a square root folder Okay Inside the square root. I need to create one main dot py file And the same way static css and I have a templates So I can just simply copy this template here and I can Put it like this And same way css also Okay, I can I have now style.css. I have a index.html everything I can just simply replace this code whatever Bar has generated. So this is the html code. Let me copy it This is html Okay Square root it will generate See again, it is giving the style something like this. So instead of that I have to go for Okay, I have to it has to be inside the static I want to copy like static here Okay, I'll just remove this css static style.css So it will be like static style Slash I mean css.style.css Okay, I think index.html is fine for us. The next thing is style.css Style link We'll just grab this one Okay And in our main.py file Yeah, this is our python code Okay, so negative number is also it's handling and index.html Okay, let's see how it goes so I can just go to my terminal and I'm just going to exit my earlier application. Let me go back And we'll just go for square root python Main.py Yeah, it just started running. Let's see how it goes Let me close our earlier application And I'll just navigate to the same URL. Yes, fantastic. Let's say I'll just go ahead with 25 And the square root of 25 is 5.0. Let's say sum 98 Yeah, decimal number also it has given Let's try with some negative number. Let's say minus 9 Okay, negative number do not have a real square root So in this case the moment we give a correct instruction slowly slowly will learn about this thing And it will give the correct code for us. There are a few things it has mashed up But that's perfectly fine like this static path and all those things. We just manually change it All right, everyone That is all about the web application creation code generation with the bar For our python flash web framework same way you can generate this code for other framework in a python also All right, everyone. So in this video, we are going to take a help from bar, but Now we are not going to create a web application instead of that For the same purpose, let's say for the finding your square root We want to create some GUI based python application. Okay, so can bar generate a code for us or not Okay, so what I can try with what are the GUI framework first of all available? Okay Let me reset my earlier chat. What are GUI for python And for one of them, we are going to create it Okay, so there are frameworks like a pyqt. We have givey. We have a kinter. Okay, we can try with kinter. Okay We can try with a kinter. Okay, so generate Code to find Let's say square root of a number Create python GUI app with a kinter, okay Now if this kinter is not installed in your machine, we have to install it kinter, okay Okay, that is fine. I guess let's see what it will generate actually Otherwise we'll just change something in a prompt. Okay, very simple application. See That's good enough. Let me copy it and let me put it into my code Now this is about the web application. So we have a GUI. So I'll just create one more file here GUI.py And definitely I need this kinter. Now, I'm not sure whether kinter is installed or not But I can just simply run and let's see if any error comes Let's say GUI Uh, okay, directly we have a GUI here only so python GUI Uh, okay, uh calculate underscore square root is not defined. Okay. What the heck is this? Calculate square is not defined Why? It has been defined So we can uh straight away. Uh, I mean ask to Let me just go And copy this one only. I got this error in above code Please rewrite the code for me I got below Error in Above code Please rewrite Code for me Okay, so hopefully, uh, it has corrected those mistakes because it has not defined this function earlier and python is like an interpreter language Okay, let me copy it And paste it here Now I'm going to run this once again Okay, very small UI, but that's fine Uh, like can I make it a little bigger? Okay, let's say I'll just go ahead with your 45 Yeah, the square root of 45 is a six point. Can I try with some minus nine? Okay, error because this is thing not being handled, but that's fine. Let me just go with some other number. Yeah, it's working Uh, let's say I'll just uh do with uh, let's say some 64 Yeah, it's 8.0. So that means it's working fine Now in my case, this kinder was already installed If it is not installed you can just ask again bar This kinder installation And that's very simple. See this kinder install kinder Or you can just simply elaborate it also See you can use pip install tk All right, then some sample code also it has given so same way, uh, some g y web I mean g y application of python also Uh, one can create it. It's all about Your prompt engineering that how good the prompt you will give All right, everyone, that's all about this video and I'll catch you in the next one All right, everyone welcome back So so far, uh, I mean we have dealt with the python code. Okay Now assume that you know a little bit about the python They can help from this bar to generate your own application and keep just asking Question to add some more code inside it. But let's say something you absolutely don't know Let's say some other programming language, which is quite in demand nowadays Let's say react and you want to learn about this react So you can just simply ask to bar itself that Can you create? Uh curriculum Curriculum Okay now suggestion curriculum, uh for me To Learn The react gs I am absolute beginner. I can say beginner Okay, let's see what it will generate All right, so you can see week one plan learn the basics of javascript including variables Function and objects are now this reacts are like a javascript library So they are expecting you to first learn basics of javascript. That's fantastic In a second week plan third week plan and a fourth week plan And they are saying that this is just the basic curriculum now Suppose you start it following this particular curriculum Then you can just simply go. I mean deeper and deeper into it something like let's say I want to learn a little bit about this three framework In a react just simply type here Give me some idea about uh, give me some idea about that What is this web uh back bevel just I don't know. So that's a javascript module bundler Bevel is javascript compiler. Just is javascript testing framework. So Once you get little idea about it, you can go even deeper into it and give me some uh sample code in a bevel like Give me some sample code Bevel Okay, see this is the sample code in a bevel It has given Okay, so based on whatever curriculum it has generated we can even uh, okay No other drafts. It has generated. Can you generate some uh, I mean even detailed curriculum for react Let's give can you generate? even detailed Uh like a lecture wise Curriculum for react JS, okay Okay, so very first thing. What is react? Uh, why to use react? You can just keep asking to bar itself that why use react simple See 10 lecture plan it has given us uh to learn about it So you can just simply read and try to digest it Uh, why you should go for react and you'll get uh, I mean you can do the comparison with some other javascript Library also why react is great at some place Why you should use some other library if you're building some specific kind of application where react may not be helpful So this way you can enhance your knowledge. You can learn about it while keep interacting With such a kind of AI chatbot. Okay, so that is how one can learn an absolute different new topic from the bar also