text
stringlengths
1
81
start
float64
0
10.1k
duration
float64
0
24.9
with the library and the last step which
5,455.56
3.9
is really just one line of code broken
5,457.96
3.779
onto three so that it all fits I'm going
5,459.46
4.62
to save the first image but I'm asking
5,461.739
5.281
the library to append this other image
5,464.08
4.86
to it as well not bracket zero but
5,467.02
3.6
bracket one and if I had more I could
5,468.94
4.199
express those as well I want to save all
5,470.62
4.44
of these files together I want to pause
5,473.139
4.861
200 milliseconds a fifth of a second in
5,475.06
5.099
between each frame and I want it to Loop
5,478
6.239
infinitely many times so now if I cross
5,480.159
7.201
my fingers as always hit enter
5,484.239
5.221
nothing bad happened and that's almost
5,487.36
5.1
always a good thing let me now run code
5,489.46
7.56
of costumes dot Jif to open up in vs
5,492.46
7.08
code the final image and what I think I
5,497.02
6.119
should see is a very happy cat and
5,499.54
5.46
indeed so now we've seen not only that
5,503.139
3.661
we can read and write files be it
5,505
4.08
textually we can read and now write
5,506.8
4.74
files that are binary zeros and ones
5,509.08
4.079
we've just scratched the surface this is
5,511.54
3.78
using the library called pillow But
5,513.159
3.601
ultimately this is going to give us the
5,515.32
3.18
ability to read and write files however
5,516.76
4.379
we want so we've now seen that via file
5,518.5
4.44
i o we can manipulate not just textual
5,521.139
4.321
files be it txt files or csvs but even
5,522.94
4.739
binary files as well in this case they
5,525.46
4.199
happen to be images but if we dived in
5,527.679
3.96
deeper we could find explore audio and
5,529.659
4.261
video and so much more all by way of
5,531.639
3.781
these simple Primitives this ability
5,533.92
4.799
somehow to read and write files that's
5,535.42
7.16
it for now we'll see you next time
5,538.719
3.861
so
5.6
7.639
[Music]
7.35
5.889
[Music]
15.28
6.869
all right this is cs50s introduction to
24.16
4.959
programming with python my name is david
27.119
4.4
maylin and this is our week on libraries
29.119
5.361
so libraries are generally files of code
31.519
4.481
that other people have written that you
34.48
3.919
can use in your own programs or a
36
4.079
library's code that you've written that
38.399
3.121
you can use in your own program but
40.079
3.281
maybe not just this program but another
41.52
4.719
and another as well so python supports
43.36
5.12
exactly this idea this ability to share
46.239
4.64
code with others share code across your
48.48
4.32
own projects and it does so by way of
50.879
4.481
what it calls module a module in python
52.8
5.12
is just a library that typically has one
55.36
4.879
or more functions or other features
57.92
4.479
built into it generally the purpose of a
60.239
4.481
library or a module specifically is to
62.399
4.4
encourage reusability of code if you
64.72
4.48
find yourself using the same types of
66.799
4
functions again and again the same
69.2
3.52
functionality if you find yourself
70.799
4.881
copying and pasting from an old project
72.72
4.8
into your new project odds are there's
75.68
4.4
an opportunity there to factor out that
77.52
4.48
code that you keep copying and pasting
80.08
4.32
that you keep reusing and put it into a
82
4.799
library that you can then load into your
84.4
4.48
programs moving forward so as to not
86.799
3.601
just copy and paste it and have all
88.88
3.36
these different copies all over
90.4
3.759
so what are some of the modules or
92.24
3.919
libraries that python comes with well
94.159
4.241
python comes with a random library
96.159
3.92
literally which is to say that when you
98.4
3.84
install the python interpreter on your
100.079
4.641
mac or pc or somewhere in the cloud not
102.24
4.08
only do you get python you get a whole
104.72
3.84
bunch of modules as well now these
106.32
4.079
modules provide you with functions that
108.56
4
you don't have access to just by default
110.399
4.881
like you do print and input print and
112.56
4.72
input and other such functions just work
115.28
4.56
in python but sometimes functions are
117.28
4.879
tucked away in these modules so you have
119.84
4.4
to be more deliberate about loading them
122.159
4.481
into the computer's memory so somewhere
124.24
3.92
on the computer's hard drive once you've
126.64
3.679
installed python there is also it turns
128.16
5.439
out a file probably called random.pi
130.319
5.121
that someone else wrote probably long
133.599
4.081
ago but that you have access to and in
135.44
4.48
that random.pi file there's probably one
137.68
4.16
or more functions that you yourself can
139.92
5.2
use in order to do things randomly that
141.84
5.759
is to say how could you flip a coin in a
145.12
4.8
program in python how could you pick a a
147.599
5.28
random number between 1 and 10 in python
149.92
4.48
well you need a bit of randomness and
152.879
3.121
while you could figure out
154.4
3.6
mathematically how to write functions
156
4.4