text stringlengths 1 81 | start float64 0 10.1k | duration float64 0 24.9 |
|---|---|---|
might read and write from a file and do | 4,997.219 | 3.841 |
so in a structured way where you can | 4,999.199 | 4.201 |
somehow have multiple Keys multiple | 5,001.06 | 4.619 |
values all in the same file without | 5,003.4 | 3.66 |
having to resort to what would be | 5,005.679 | 4.02 |
otherwise known as a binary file so a | 5,007.06 | 4.679 |
binary file is a file that's really just | 5,009.699 | 4.201 |
zeros and ones and they can be laid out | 5,011.739 | 4.081 |
in any pattern you might want | 5,013.9 | 3.96 |
particularly if you want to store not | 5,015.82 | 4.5 |
textual information but maybe graphical | 5,017.86 | 5.7 |
or audio or video information as well so | 5,020.32 | 5.16 |
it turns out that python is really good | 5,023.56 | 3.84 |
when it comes to having libraries for | 5,025.48 | 3.84 |
really everything and in fact there's a | 5,027.4 | 4.259 |
popular Library called pillow that | 5,029.32 | 5.64 |
allows you to navigate image files as | 5,031.659 | 5.881 |
well and to perform operations on image | 5,034.96 | 4.62 |
files you can apply filters a lot | 5,037.54 | 4.86 |
Instagram you can animate them as well | 5,039.58 | 4.68 |
and so what I thought we'd do is leave | 5,042.4 | 3.72 |
behind behind text files for now and | 5,044.26 | 3.899 |
Tackle one more demonstration this time | 5,046.12 | 5.64 |
focusing on this particular library and | 5,048.159 | 5.881 |
image files instead so let me propose | 5,051.76 | 4.86 |
that we go over here to vs code and | 5,054.04 | 4.679 |
create a program ultimately that creates | 5,056.62 | 3.9 |
an animated gif these things are | 5,058.719 | 3.841 |
everywhere nowadays in the form of memes | 5,060.52 | 3.78 |
and animations and stickers and the like | 5,062.56 | 4.079 |
in an animated gif is really just an | 5,064.3 | 4.379 |
image file that has multiple images | 5,066.639 | 5.04 |
inside of it and your computer or your | 5,068.679 | 5.401 |
phone shows you those images one after | 5,071.679 | 4.921 |
another sometimes on an endless loop | 5,074.08 | 4.86 |
again and again and so long as there's | 5,076.6 | 4.26 |
enough images it creates the illusion of | 5,078.94 | 3.9 |
Animation because your mind and mind | 5,080.86 | 4.08 |
kind of fills in the gaps visually and | 5,082.84 | 3.839 |
just assumes that if something is moving | 5,084.94 | 4.199 |
even though you're only seeing one frame | 5,086.679 | 4.98 |
per second or some sequence thereof it | 5,089.139 | 4.381 |
looks like an animation so it's like a | 5,091.659 | 4.381 |
simplistic version of a video file well | 5,093.52 | 4.679 |
let me propose that we start with maybe | 5,096.04 | 5.099 |
a couple of uh costumes from another | 5,098.199 | 4.801 |
popular programming language and let me | 5,101.139 | 3.721 |
go ahead and open up my first cost team | 5,103 | 3.96 |
here number one so suppose here that | 5,104.86 | 3.72 |
this is a costume or really just a | 5,106.96 | 3.199 |
static image here | 5,108.58 | 3.659 |
costume1.jif and it's just a static | 5,110.159 | 4.661 |
picture of a cat no movement at all let | 5,112.239 | 5.361 |
me go ahead now and open up a second one | 5,114.82 | 5.28 |
costume2.jif that looks a little bit | 5,117.6 | 4.539 |
different notice and I'll go back and | 5,120.1 | 4.5 |
forth this cat's legs are a little bit | 5,122.139 | 4.381 |
aligned differently so that this was | 5,124.6 | 5.22 |
version one and this was version two now | 5,126.52 | 4.74 |
these cats come from a programming | 5,129.82 | 3.359 |
language from MIT called scratch that | 5,131.26 | 3.84 |
allows you very graphically to animate | 5,133.179 | 4.261 |
all this and more but we'll use just | 5,135.1 | 5.76 |
these two static images costume one and | 5,137.44 | 5.88 |
costume two to create our own animated | 5,140.86 | 4.56 |
gif that after this you could text to a | 5,143.32 | 4.379 |
friend or message them much like any | 5,145.42 | 5.1 |
meme online well let me propose that we | 5,147.699 | 5.101 |
create this animated gif not by just | 5,150.52 | 3.9 |
using some off-the-shelf program that we | 5,152.8 | 3.359 |
downloaded but by writing our own code | 5,154.42 | 4.219 |
let me go ahead and run code of | 5,156.159 | 4.621 |
costumes.pi and create our very own | 5,158.639 | 4.6 |
program that's going to take as input to | 5,160.78 | 5.04 |
or even more image file files and then | 5,163.239 | 5.101 |
generate an animated gif from them by | 5,165.82 | 4.26 |
essentially creating this animated gif | 5,168.34 | 4.56 |
by toggling back and forth endlessly | 5,170.08 | 5.34 |
between those two images well how am I | 5,172.9 | 4.02 |
going to do this well let's assume that | 5,175.42 | 2.759 |
this will be a program called | 5,176.92 | 4.08 |
costumes.pi that expects uh two command | 5,178.179 | 4.98 |
line arguments the names of the files | 5,181 | 4.08 |
the individual costumes that we want to | 5,183.159 | 4.141 |
animate back and forth so to do that I'm | 5,185.08 | 3.659 |
going to import sys so that we | 5,187.3 | 4.379 |
ultimately have access to sys.org V I'm | 5,188.739 | 4.741 |
then from this pillow Library going to | 5,191.679 | 3.96 |
import support for images specifically | 5,193.48 | 6.12 |
so from pil import image capital i as | 5,195.639 | 6.301 |
per the library's documentation now I'm | 5,199.6 | 3.66 |
going to give myself an empty list | 5,201.94 | 3.42 |
called images just so I have a list in | 5,203.26 | 4.14 |
which to store one or two or or more of | 5,205.36 | 4.68 |
these images and now let me do this | 5,207.4 | 7.56 |
for each argument in sis.org V I'm going | 5,210.04 | 6.42 |
to go ahead and create a new image | 5,214.96 | 5.179 |
variable set it equal to this image | 5,216.46 | 7.5 |
dot open function passing in ARG now | 5,220.139 | 6.401 |
what is this doing I proposing that | 5,223.96 | 3.9 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.