 Hey everyone, welcome back to another Python programming video and tutorial in this video and that in this series now I want to be looking at the end pie screen module. So this is really really cool I've got the documentation up online the URL is and a pie screen it dot read the docs dot org if you want to go Through it um Honestly, you could use the documentation as a tutorial and the learning tool is yourself But I hope to have my videos kind of supplement and help guide you through that But here it is so this module is nifty because it's a Python widget library in an application framework for programming the terminal or Console applications it's built on top of end curses which is part of the standard library And I'm pretty sure this is only specific to Linux or Unix systems because it uses Curses like the Python curses library. So that's specific only to Unix and Linux so it's it's Designed for kind of rapid user interface development in the command line for the console So that's pretty awesome like it shows you some pretty simple code here, and it's quick and easy So I'm excited about this because I'm pretty sure I'm the only one so far on YouTube that has Released tutorials on this. I've seen a demonstration video, but I haven't seen any video guides for it So I hope this is a good thing for you guys Okay, so this is pretty much a demonstration as to some of the cool stuff you can do there are input texts There are I don't know why my cursor is spazzing out. Sorry about that guys There's a of course a header for every form that you create There are files that you can browse to dates that you can set and progress bars and sliders Multi-line inputs checkboxes and radio options and I don't know really cool stuff So there is some code that it shows off to you I won't get into all of that yet because I want to give this to you piece by piece and have you Cumulatively learn it so some the strength that this thing has though It's powerful enough to create everything from quick simple programs to really complex multi-screen stuff So that's why it's a really nifty language not a lift not a lifting language Sorry, but a really cool library that I'm excited to show you So it does kind of give this note that it's being developed on Python 3 But the code is compatible enough with modern releases of Python 2 So I've been using Python 2.7 to play with it and run it and I'm not having any problems whatsoever So I'm pretty sure whatever version you're running as long as it's recent and good You'll be fine So it does note here There are similar projects like Erwin and of course there is the endcurses back end But it gives this description here that Erwin is more of a traditional event driven GUI library and targets other display devices as well as curses I might get into Erwin eventually, but I mean for now. I want to teach you guys and pie screen. So I'm sorry about my cursor. I don't honestly know what it's doing. All right so the next part of actually getting into this language other sorry I keep saying language this library is Installing it right so We can do this with pip if you guys don't have pip you can pseudo app get install pip But pip is you know like a Python Installation package manager. So it's pretty cool. So we can say pseudo pip install and pie screen Now it'll ask you for your password Go ahead and enter that in it'll download it and successfully install it. So awesome. We're set Okay I'll get into a small Demonstration as to what it can do right now. Okay, so this is all my my learning stuff here. I'll try in for your new folder Teaching Nope save this untitled. I want it as a zero one pie. So let me fire that up NP learning and teaching She mod plus X zero one that pie And we'll be able to run zero one dot pie whenever we're ready. So, okay I want my shebang line as usual and of course we will import and pie screen the new module that we're looking at and Here I want to get into how it works So you know in the command line and obviously on your console in your shell you have kind of an input and Output kind of system right you enter things in and then it displays things out to you and That's pretty much how the console normally works, but if you're looking at things like mutt or links or you know those those programs Okay, I don't have them and solve to be able to demonstrate to you But some of the command line ones are kind of like an application That's manipulating the terminal screen and putting pixels specifically where they want to go. That's curses, right? that's the Terminal manipulation stuff. That's part of end curses and the curses mode so N pi screen has a nifty wrapper that allows you to get in and out of the curses mode really really easily for those of you That might have known it in other ones It's like in its screen and then you can set up a keypad turn things on and off and then you would turn on no echo and I don't know you would run a bunch of other functions that are kind of boring. I guess they're not boring, but Boilerplate code to get you to do what you need to do So this is all wrapped up in one simple function for n pi screen and I want to show you how it works So first of all, we'll define a simple function That is not going to do anything whatsoever But it is going to take arguments and I'm using a asterisk here to note that it could take multiple arguments kind of packed into one and Like I said, it's not going to do anything. So we'll just have it pass so We'll do our pretty much Normal line if we actually want to run our code if name is equal to main now What the function that is that kind of does this for you wraps curses is called wrapper underscore basic and then you pass in your function Now this is going to do literally nothing It's it's going to look like it's doing literally nothing when you run it on our console here Yeah, so like you see this all this space because we initialize curses and then we immediately hopped out of it because it Wasn't doing anything if I were to just say print This comes in and out of curses mode That's literally all you're doing. I know it's not interesting whatsoever But I want to do establish that and have that concept in your mind because that's the bare-bone basics of what MPI screen is doing Of course, everything in MPI screen is displayed with the curses mode on So I wanted to show you how it works behind the scenes You'll never pretty much use this wrapper basic function in the development process If you actually make like something with this if you actually use it as a tool But I want you to know that it's there and that's how it works It goes over it in the documentation and tutorial they have online I would recommend checking that out I'll probably use it as a kind of a reference point when we're looking at the API reference and stuff in it the more of the functions and things that we can do with it, but Kind of for the introduction tutorial that they give you they do show off that wrapper basic Rapper basic function. Okay, so that's all I want to demonstrate to you guys so far Installation and intro and kind of giving you a background as to what this library is. I didn't say language that time awesome Okay, that's all I want to show you. Thank you so much for watching guys I hope you're gonna be interested in this series as much as I am and I'll see you in the next video Bye