1 00:00:04,900 --> 00:00:10,880 Encoding and decoding on Jason Kidd over what they were going to do. 2 00:00:10,900 --> 00:00:16,080 How you can use Jason that's files while using Python. 3 00:00:16,480 --> 00:00:25,120 So the python basically enables Python objects to be represented in a string of characters in the style 4 00:00:25,130 --> 00:00:26,080 of the jigsaw. 5 00:00:28,120 --> 00:00:33,670 So in order for that, actually, you know, you can see the time in the Python idiom, but actually 6 00:00:33,700 --> 00:00:35,090 I'm going to pull a terminal. 7 00:00:35,650 --> 00:00:40,390 So let me create the terminal here and let me increase. 8 00:00:43,230 --> 00:00:49,830 The size of the terminals, we can see better and what it will do here, I will do I will go in python 9 00:00:49,830 --> 00:00:50,270 mode. 10 00:00:51,570 --> 00:00:57,300 So let's dive Python and you can see that now you can type Python and simply type in for. 11 00:00:58,720 --> 00:01:03,730 Jason, the Jason is still important and now let's create. 12 00:01:04,730 --> 00:01:12,410 A list of books throughout the books equals to the book while. 13 00:01:13,910 --> 00:01:14,510 Guillermo. 14 00:01:16,250 --> 00:01:26,880 Lamely figures out spending, so Bourquin, then Bulc to book three and that's it. 15 00:01:26,900 --> 00:01:34,280 So let's create this list, as you can see, September and then if you chase some dot dump's. 16 00:01:35,900 --> 00:01:41,570 Not in the Brit section, so dump's. 17 00:01:42,590 --> 00:01:45,350 And in the break, it's write books. 18 00:01:46,070 --> 00:01:48,770 OK, yes, and this is here. 19 00:01:48,800 --> 00:01:50,560 So it will be thumbs. 20 00:01:51,530 --> 00:01:57,740 And now we're creating the adjacent object, as you can see, of book one, two, two and book three. 21 00:01:58,310 --> 00:02:07,160 So what the adjacent thumbs is actually doing, it allows you to transform director type object as a 22 00:02:07,160 --> 00:02:09,570 first parameter into the JSON format. 23 00:02:10,130 --> 00:02:19,970 So obviously the adjacent string that's created is very similar to the own representation of Python 24 00:02:19,970 --> 00:02:22,560 list, but it is a string. 25 00:02:23,030 --> 00:02:25,580 So how we know that is actually a string. 26 00:02:25,820 --> 00:02:34,810 If a right string underscore books equals Jason dot dumps. 27 00:02:35,510 --> 00:02:41,630 And now here in the bracket I write again, bow one common. 28 00:02:42,670 --> 00:02:46,720 Book to call mom and boo. 29 00:02:48,250 --> 00:02:48,730 Three. 30 00:02:49,290 --> 00:02:57,690 OK, so once they do that, the three books is created and how do we know this? 31 00:02:57,760 --> 00:03:00,590 So I can simply simplify type. 32 00:03:02,290 --> 00:03:13,940 And then during underscore pause, OK, so if you watch the tape of that file, it is actually a string. 33 00:03:14,590 --> 00:03:19,540 So here's how we can confirm that will create the from the list in Python. 34 00:03:19,750 --> 00:03:24,380 We actually transfer it to the adjacent file, which obviously is a string. 35 00:03:24,700 --> 00:03:32,120 Now, you know how to transfer from Python to Jason, but how to transfer from Jason to Python. 36 00:03:32,420 --> 00:03:37,980 Obviously, some of the files are to receive from the Web are going to be in G some format. 37 00:03:38,230 --> 00:03:44,680 But if you want to translate the data into Python infused into Python, obviously you need to write 38 00:03:44,680 --> 00:03:50,060 some comment in order to do this transfer from Jassam to Python. 39 00:03:50,590 --> 00:03:53,170 And let me tell you how this section is done. 40 00:03:53,470 --> 00:03:55,180 So if I write a string. 41 00:03:56,380 --> 00:03:57,230 Underscore. 42 00:03:57,850 --> 00:04:07,770 Actually, let's try to just Beukes equals again, Labourite book one. 43 00:04:09,260 --> 00:04:11,570 Cuomo woke to. 44 00:04:13,690 --> 00:04:15,270 And book three. 45 00:04:15,730 --> 00:04:21,800 OK, and let me just be an actual string, OK? 46 00:04:22,540 --> 00:04:24,820 And then I write list. 47 00:04:26,510 --> 00:04:29,250 List will be equal to Jason. 48 00:04:31,140 --> 00:04:32,460 Talk to Wolds. 49 00:04:34,170 --> 00:04:35,810 Cuomo books. 50 00:04:36,460 --> 00:04:36,960 OK. 51 00:04:37,570 --> 00:04:42,120 OK, I can see them here, I have an error in the books because I didn't put. 52 00:04:43,850 --> 00:04:44,440 Colin. 53 00:04:45,520 --> 00:04:51,290 Here, so when they fix that and when they run the command, OK, we're going to get them there. 54 00:04:51,460 --> 00:04:59,910 Let's see what this witness, because we had a problem with the same columns, and I will just leave 55 00:05:00,220 --> 00:05:08,440 a single parenthesis out there and inside I will double what I think this would fix the problem. 56 00:05:08,860 --> 00:05:14,320 So just change those and you see how everything will run actually very smoothly. 57 00:05:14,770 --> 00:05:16,640 So limited changes. 58 00:05:16,930 --> 00:05:20,550 So this is the right way that you should write the books. 59 00:05:21,460 --> 00:05:22,440 OK, ok, great. 60 00:05:23,110 --> 00:05:24,370 And then just write. 61 00:05:24,370 --> 00:05:28,330 And this equals just some dos and don'ts folks. 62 00:05:29,260 --> 00:05:29,540 OK. 63 00:05:29,650 --> 00:05:31,550 You can see that now this sentence. 64 00:05:32,080 --> 00:05:41,460 So the laws function actually you can transfer a file from Jassam form to an actual title for a month. 65 00:05:41,680 --> 00:05:47,950 And as you can see, when the created is substring because it is under parenthesis. 66 00:05:48,070 --> 00:05:48,430 Right. 67 00:05:49,490 --> 00:05:55,160 So what we did here later will create the list would suffice to list, and you're right, the Jassam 68 00:05:55,190 --> 00:06:00,470 loads and then the Jassam file that you want to transfer into Python file. 69 00:06:00,860 --> 00:06:02,570 So now we have a right to list. 70 00:06:03,230 --> 00:06:05,440 You see that one book, too. 71 00:06:05,570 --> 00:06:10,580 And this had to be actually tree limb changer just to be consistent. 72 00:06:11,810 --> 00:06:12,650 So. 73 00:06:13,670 --> 00:06:14,190 Getting. 74 00:06:15,970 --> 00:06:21,230 This and you can see that BOOP section up by the list here. 75 00:06:21,250 --> 00:06:26,190 In that case, because he's just not surrounded by apprentice's from both sides. 76 00:06:26,410 --> 00:06:34,390 So this whole transfer from Jason to an actual Biton parameter, you can also create this in an actual 77 00:06:34,960 --> 00:06:35,950 python file. 78 00:06:36,130 --> 00:06:44,920 OK, so for that reason, our first exit from the python mode here and I will go to, though, our resources 79 00:06:44,920 --> 00:06:47,810 folder where we create all our files. 80 00:06:48,220 --> 00:06:56,410 So let me first go to a source folder from the terminal and then we will go back to our idea and look 81 00:06:56,680 --> 00:06:58,840 that the files here are not sorted. 82 00:06:59,590 --> 00:07:06,880 I'm going to provide you the actual Python files and they're going to be quite sorted for every section 83 00:07:06,880 --> 00:07:07,630 that we have here. 84 00:07:07,660 --> 00:07:13,240 We will have different folder with all the files that you need in order to have the source code for 85 00:07:13,240 --> 00:07:13,830 discourse. 86 00:07:14,050 --> 00:07:15,430 So don't worry about that. 87 00:07:15,730 --> 00:07:17,920 But let me now go to the resource folder. 88 00:07:18,400 --> 00:07:19,290 So I see. 89 00:07:20,050 --> 00:07:26,290 So actually, let's created here in our resources folder, our new directory, and the new director 90 00:07:26,290 --> 00:07:28,720 will be called Section three. 91 00:07:30,120 --> 00:07:36,900 OK, and here I wasn't the new Python files that were used for discourse, so let me close our previous 92 00:07:36,900 --> 00:07:41,220 files and now under Section three, I will create the new. 93 00:07:42,580 --> 00:07:43,210 On file. 94 00:07:44,650 --> 00:07:48,640 And the name of the file will be called Books. 95 00:07:49,030 --> 00:07:53,010 OK, so let's now right here for Jason. 96 00:07:54,210 --> 00:07:57,490 OK, and let's write with. 97 00:07:59,080 --> 00:08:03,280 Open books, dogs chase some. 98 00:08:04,550 --> 00:08:05,050 OK. 99 00:08:05,080 --> 00:08:07,920 This is the name and that's right. 100 00:08:08,780 --> 00:08:09,620 Our team. 101 00:08:11,960 --> 00:08:14,570 So let's actually remove the words here. 102 00:08:15,170 --> 00:08:23,090 OK, our team US file and then balls equals Jason. 103 00:08:24,370 --> 00:08:27,970 Don't load this file. 104 00:08:28,840 --> 00:08:29,190 OK? 105 00:08:31,180 --> 00:08:32,170 And then this Friday. 106 00:08:33,840 --> 00:08:34,530 For instance. 107 00:08:37,650 --> 00:08:38,230 Books. 108 00:08:38,930 --> 00:08:39,440 OK. 109 00:08:40,880 --> 00:08:43,040 And finally, all right, Prince. 110 00:08:44,750 --> 00:08:45,170 They. 111 00:08:47,290 --> 00:08:47,900 Books. 112 00:08:48,580 --> 00:08:58,570 OK, so that's our file, let's say that now and obviously for this to work, you need to have a Jassam 113 00:08:58,570 --> 00:08:59,010 file. 114 00:08:59,170 --> 00:09:00,070 That makes sense. 115 00:09:00,400 --> 00:09:07,180 So Jason, finally will from the download from the Internet or this will be translated to from Internet 116 00:09:07,480 --> 00:09:08,620 to adjacent file. 117 00:09:08,980 --> 00:09:13,300 So let me pull up the example file that we are going to use. 118 00:09:13,660 --> 00:09:15,840 So I do it just from the Internet. 119 00:09:16,570 --> 00:09:19,420 So let's say these are different books with title. 120 00:09:19,900 --> 00:09:27,130 And as you can see, those books that have title out, your publisher and so on are the ones who work 121 00:09:27,130 --> 00:09:27,370 with. 122 00:09:27,730 --> 00:09:35,320 So I will provide this file obviously in the source code to me just to download it and add it to your 123 00:09:35,320 --> 00:09:37,230 sections folder, as I did already. 124 00:09:37,240 --> 00:09:40,810 So it's in the same folder as a books, not pure white file. 125 00:09:41,080 --> 00:09:42,820 And now if I go into terminal. 126 00:09:44,540 --> 00:09:52,730 And I assess, first of all, the Section three, let's now run, so I write Python. 127 00:09:54,950 --> 00:10:03,170 And then walks those few white and those you can see here, we have the following output with all the 128 00:10:03,170 --> 00:10:08,390 books that we assess and they are actually made into a list. 129 00:10:08,870 --> 00:10:11,560 So you can see that they may actually cover it. 130 00:10:11,960 --> 00:10:15,290 So you can see that here is the first element of the list. 131 00:10:15,710 --> 00:10:19,250 OK, then we have the next element on the list and so on. 132 00:10:19,640 --> 00:10:22,940 And you can also see that the class here is actually a list. 133 00:10:23,150 --> 00:10:27,950 So we successfully transferred the adjacent file into a pattern of representation. 134 00:10:29,720 --> 00:10:36,710 So this was everything I want for you guys today, a little introduction to how a transfer from Jason 135 00:10:36,710 --> 00:10:38,870 to Python files and the other way around. 136 00:10:39,210 --> 00:10:41,240 That said, thank thanks very much for watching. 137 00:10:41,240 --> 00:10:42,940 And I will see you in the next video.