 Hello everybody and welcome back to more Python challenge. It's been a really long time since I've made these videos But I hope to kind of get back in the groove where we left off. We were on this peak We just moved to the fifth challenge on Python challenge We finally got here and what we're staring at right in front of us is this picture of I guess a green hill or peak a hill I Don't know the the only kind of hint that we have here is pronounce it and there's literally nothing else on the page There's no scroll bar or anything else. I can see so it just says pronounce it Hill Grass mountain, I don't I don't know what else it's getting at. I mean obviously okay peak I Can see up at the top the title of the page is oh, that's my sublime text window I'm sorry the title of them the of the Firefox, and it was peak hell peak I don't know what else I can get from pronouncing it. Wait, I'm gonna kind of See what we can do if we look at the source Because that seems to be a pretty common trend with all these title peak hell Style that CSS I Wonder if there's anything in the CSS file and there's the image of the peak hell JPEG pronounce it And the comment here is peak hell sound familiar peak hell Peek hill peak hill kill peas. Oh Peekle pickle is that right? Pickle is peak I'm gonna go to my your belt peak hill be killed in HTML doesn't exist Is there a hill that HTML? He'll make you know Peekle, I'm gonna try pickle. I'm gonna do it Pickle pickle the HTML. Yes pickle Okay What does that help me with? pickle um Google Python pickle Hey, okay That's a thing. I'm gonna go to the documentations. Oh, okay The pickle module implements a fundamental but powerful algorithm for serializing and deserializing a Python object structure. I Don't know what that means Serial to arrange something in a series Probably makes the most sense here. Oh In computer science and see Wikipedia in computer science Serialization is a process of translating data structures to format that can be stored And reconstructed later in the same way. Okay. It's cool So what does that help me with for my picture? I have a I have a picture of a hill here Close out a Wikipedia Pickling is a process where a Python object is converted to a byte stream and unpickling is the inverse operation Okay And it's converting to and from an object hierarchy How do I use it? What does it do? To serialize an object you first create a pickler and then you call the pickler's dump method To deserialize the data stream you first create an unpickler and then you call the unpickler's load method Okay So which one are we gonna want to do I? Have an image Anything else what can be pickled and unpickled okay following thing can be pickled boolean values Numbers strings Do I have to read the raw data of the image or something? I'm looking at the source of my time You paid source There's nothing in the CSS file is there? Style Yeah, I didn't think so. Oh, it was worth it. Um, oh What is this? That's not HTML. I don't think not not at any HTML versions. I seen there was no tag called pKal And it's okay sources better dot P Can I go there better dot P? Oh? Save file just show me in Google Chrome Whoa Whoa What is all that I just zoomed in a bunch so you can see this I? Don't know what any of this is But if I were to guess This is probably Like the output of something that has been pickled So we need to unpickle it right? It says If you if you to de-serialize the data stream you first create an unpickler and then you call the unpickler's load method Okay, is that what we're gonna do on this mess? Let's try it What I'm gonna do is Download that so I'm gonna view the page source again look on this guy. Oh, I think I just did in my URL Yeah, and I save the file. I'm gonna save it to my desktop because that's where I actually have my Python file right now And I'm gonna go into my text editor sublime text It looks like the pickle module is yeah, it's part of the Python standard library So we should just be able to import it pretty easily import pickle and How do I use load? Pickle dot load we just string from the open file object file. Okay, so Pickle dot load, and I just save the file in my desktop banner dot P Listen to be I guess If I print that out, what do I get? String has no attribute read line What? Read a string from the open file object file. Okay. Okay. It has to be an object file So I have to I'd use pipe you have to use pythons Built-in function open as if you were opening this file like an object handle And now when you're on this, whoa We get a list of stuff You can see it down here at the bottom of my text editor It looks like I see one array, and I see another array you can see the opening braces And it's filled with like tuples or tuples. I guess Can we loop through that? What do we do with that? It's a character and then a number so, okay if I I I Would think that if it's it's like kind of compressing these things or serializing them these data things That means to put in a series, right? Serializing yeah, I ran something in a series. So maybe this character has just repeated this number of times so Let's let's look at it for item in Pick that's gonna be one of the arrays And I can see there's multiple and I want to get the tuples inside so for Thing in item. Yeah, I guess Can I print the thing? What do I get here? Okay? Yeah, so now it's like a boatload of But a little tuples tuples however you want to pronounce it And I want them I want to get this character this many times So print Thing zero being the character multiplied by thing one what why is this? What if I remove the new line now, it's just a bunch of this things No, it's all in the horizontal line. That doesn't help either Maybe I have to create a new line after each Print this thing. Whoa What does it say you guys read that at all that's a C I can make that out It's a H. Oh and this one here looks like an A And I'm gonna I'm gonna open up some blind text to be a little bit bigger and have it do this one more time This is an E channel channels I'm just gonna try throwing that in In Python challenge and see what happens is it looks like it says channels, but I can't work. I can't figure it out I'm just gonna try it. So go up here channels That doesn't Is this this last character looks like an S, but is it channel is it singular? Hey, oh, okay. Okay. I guess I guess we got it sweet There we go Okay, well there we go guys. I mean We did it. Just nine lines of code is a little less Yeah, so Well, what do we learn here? I guess the pickle module. That's kind of cool serializing and deserializing Python objects And I mean that's how you I mean I guess we figured it out Just getting reading through the documentation and looking at the clues We were able to figure out that last challenge and now we're on to challenge number six Whatever heck this is Let's take a look at it in the next tutorial. Thanks for watching guys. I hope you enjoyed this