 Okay, in the previous tutorial, we made this little application here using jQuery mobile. Obviously, you can throw this up on a website or put the files locally, open them up in a web browser on pretty much any computer device regardless of operating system as long as they have a modern browser. So Android, iPhone, Windows, Linux, macOS, BSD, probably even ReactOS. So basically, it's just this list that we can search through real quick. Every basic little web application. Now we're going to package it as a standalone application so that if you didn't want to run it on your server, you could package it all in a package and distribute it on different operating systems. We're going to be using Python with GTK and WebKit today. So basically, this will run on any desktop, Windows, Mac, Linux, BSD, so on and so forth because Python being open source, GTK being open source, and WebKit being open source, they have been compiled for all these different operating systems. So basically once you basically wrap your HTML and JavaScript inside your WebKit in Python, you're good to go. You just have to make sure that each year you make an installer that will install the required packages. Once this is easy, you can make a DEB package, RPM package, or you can make a standalone little self-extracting zip. Windows is a little bit harder because it doesn't have a package manager that will install dependencies for you, so you definitely would have to create an installer that either downloads and gets those things or package them into your entire package. But basically right now I'm just going to show you the basic Python, GTK, WebKit code. It's very short. You do this and now you have written a standalone application with your HTML, JavaScript, jQuery as a desktop application. Hope that makes sense. If not, you'll see here in a moment. So as I always say, you write a program once you write it once properly, with very little to no change. You should run on pretty much all operating systems. And HTML is great for GUI interfaces because pretty much every computer has an interpreter, your web browser installed. So let's go ahead, minimize that. So list out, if you watched the previous tutorial, if you haven't, I would definitely start at the beginning of this series. There should be an annotation on the screen hopefully that will lead you to the playlist. At the end of the last tutorial, we downloaded our CSS files and JavaScript files locally. Once again, you can connect to those online if your application is going to have web access. But if not, package them in here, just put them into your file here. And we can even at this point remove our zip file here because we don't need to distribute that because it's all extracted already. So remove that. Now I'm just going to say, I'm going to use Vim as my text editor, and I'm going to create a package or a script. I'll call it MyListView.py. And we are going to start, as always, with our shebang line. So this isn't important on Windows, but it's a little more important on other operating systems, just letting our operating system know what interpreter to use. So we're going to say Pound, exclamation mark, forward slash, USR, bin, and then ENV for environment. We're going to say Python. That's just telling the operating system this is a Python script. Next we're going to import WebKit and GTK. We're actually going to import something else here in a minute, depending on how we're going to package this. You may or may not need the other module. Next we're just going to create a window object. So we're going to say, I'll call it Win. Again, that's your object name. You can call that pretty much whatever you want. But we're going to call our GTK module, which we imported up here. And we're going to say this Win object is going to be a window. So it's a GTK window. Next we'll say Win.Connect. And we'll say here, we'll give it the string destroy. This basically is going to, when you click the little X on the window, we'll kill our application. Otherwise, the window will close, but our script will keep running. And since we're only running one window script here, we want it to kill the script when we close the window. So Lombada, W colon, and then GTK.main underscore quit. And that's because we're going to run the GTK main at the end of this script. And this is just saying to kill it. In fact, let's just go ahead and do that GTK.main and that's starting all up. Nothing is visible yet though. So at this point, let's create our WebKit window. We'll create a WebObject WebKit. And definitely watch my GTK tutorial series. I go more into detail on all this. I'm trying to explain it as I go, but I've already gone over this in previous tutorials. So we'll be going through it pretty quick. But we're creating an object. We're going to call the object web. We're going to call our WebKit module, which we imported up here. And we're calling for it. We're going to say, let's make a WebView. This is going to be our viewer for our HTML code. Now at this point, I'm just going to give you an example. I'm going to say web.open. And then inside here, I'm just going to say HTTP, whoops, TTP colon four slash forward slash filmsbychris.com. To show you, you can host all these files on your website. And in many cases, I think that's a better option, because now you can modify and update your program anytime you want. And the user doesn't have to worry about their phone or desktop application, in this case, updating, because you make the changes on your website. Next time they open up the application, it's got the updates. So I'm going to show you this, but then I'm going to show you how to run the local program that you would package with this script. So open that, and then we're going to say win.add, and we're going to say our WebObject. And then we're going to say win.show underscore all. And now it's just saying, show the window and everything inside the window, because we don't have any hidden elements in this script. So it's okay to do that. If I didn't miss anything, we should get a basic window right now. So I will save that. I will use changemod plus x, myListView, the name of our script, to make it executable. And I'm going to say myListView for .slash myListView.py. And when I hit Enter, you can see we get this window here. And it's resizing, because it loaded up my website. And it's kind of funky size now, because we didn't give it any size parameters. But this is my website running inside our Python script here. And little JavaScript of me walking across the screen there. So you'll also notice, we'll get to this in a second, that it goes off the bottom of the screen. We didn't give it a window size, and we didn't give it a scroll bar. So those are things we're going to add here in a moment. But first, let's instead of running the application on the website, we'll run it locally. So I will close that. You notice I hit the X, it kills the entire application, because we did our Lombada on the destroy of the window. I'll go back into my text editor here, and we'll change some things up. First off, let's go ahead and give it a scroll bar. Actually, no, let's give it a window size first. So by default, if you don't give it a window size, the window is going to be kind of small and long, depending on your application. But it's going to be like the minimum size in some cases, very, very small. So let's give it a default size. We'll say our window object, our win object, we'll say resize, and we'll give it a size. I'll just say 600, 800. There's other options you can do to lock it in at that size if you don't want your application to change sizes. This particular application, I don't care. I just want to have a default size at the beginning here. Also as I said, it's a long application, so it like resized right away to fit the length of our HTML. If we have a long list as we do in this program, we'll run off the bottom of the screen and people can't scroll because there's no scroll bar. So here we'll say scroller, which is just an object we're creating. We're going to call it scroller. You can call it whatever you want within reason. And then we're going to call our GTK module and say we're going to make a scrolled window object. Okay. Now, we're going to say win.add, so we're taking our window object and we're adding to it our scroller object that we just created. Okay. But a window is a container that can only contain one object at a time. You need to put other containers within it, which the scroller object is. So down here we say win.addWeb. It's going to give you an error there because the windows already containing an object. So instead of adding our web object to the window, we're going to add it to our scroller. Okay. Now, also here, as you saw, we're connecting to a host file online, which is something you can do if you want to run your application off your server, which, depending on what you're doing, once again, may or may not be what you want to do. So instead of that, what I'm going to do here is I'm going to say file. My particular HTML code in here is under forward slash temp, forward slash list, forward slash index.html. So now if we save all this, and if I typed everything right, or we made the script executable, we don't have to do that again, dot slash, name of our script. And here we go. We got our application running locally. I can scroll and I can search through the list. And if I had them do anything, I could click on them. So far, that's what we've got. But you'll notice I had to put in a definite link to where the HTML file is. Let's do a little bit better. And instead, let's go ahead and tell it that we want to run the index from our local directory, our current directory. So to do that, we're going to import another module, the OS module, which is the operating system module. And I am going to put here, whoops, I'm going to say I'm going to create a little holder variable. I'm going to say path equals from our OS module dot get cwd, which will get our current working directory and put it into the path. So basically path is a string variable now. And what I'm going to do here is I'm going to say that it's a file, a local file. Then I'm going to say use the path variable we just created. And inside that path, look for the index.html. We're going to save that. We're going to run that. And you can see that's the same thing. So now, regardless of what folder we install our application to, it will always find that HTML file. So as long as they're all in the folder together, it will always find it. And you can install it anywhere on your system that you want. That's pretty much it for this tutorial. And once again, this is written in Python. So once you've created this wrapper, the short little script, which is, as I said, pretty short. It's, even with all the spaces in there, 22 lines. It's probably actually maybe 10 to 15 lines of code. Once you have that set up, you can now install this and have it run on Windows, Mac, or Linux. Because Python and GTK and WebKit run on all those operating systems already. I thank you for this tutorial. I hope you continue this series. Next, we're going to do the same thing, but with C++. And we'll probably do it with QT and WebKit rather than GTK and WebKit. So I hope you continue watching this series in packaging, web applications as standalone applications on multiple devices and computers. So please visit my site, filmsbychrist.com. There should be a link in the description. That's Chris with a K. And I hope that you have a great day.