text
stringlengths
1
81
start
float64
0
10.1k
duration
float64
0
24.9
eventually I want to be able to run
5,226.54
3.78
python of costumes.pi and then as
5,227.86
3.92
command line arguments specify
5,230.32
4.08
costume1.jif space costume two dot shift
5,231.78
4
so I want to take in those file names
5,234.4
4.68
from the command line as my arguments so
5,235.78
5.64
what am I doing here well I'm iterating
5,239.08
5.22
over sys.org V all of the words in my
5,241.42
4.98
command line arguments I'm creating a
5,244.3
3.899
variable called image and I'm passing to
5,246.4
3.96
this function image.open from the pillow
5,248.199
4.801
library that specific argument and that
5,250.36
4.62
library is essentially going to open
5,253
4.26
that image in a way that gives me a lot
5,254.98
4.02
of functionality for manipulating it
5,257.26
4.08
like animating now I'm going to go ahead
5,259
3.3
and
5,261.34
6.299
append to my images list that particular
5,262.3
7.56
image and that's it so this Loop's
5,267.639
3.721
purpose in life is just to iterate over
5,269.86
3.06
the command line arguments and open
5,271.36
4.56
those images using this Library the last
5,272.92
5.219
line is pretty straightforward I'm going
5,275.92
3.96
to say this I'm going to grab the first
5,278.139
3.54
of those images which is going to be in
5,279.88
4.44
my list at location zero and I'm going
5,281.679
5.46
to save it to disk that is I'm going to
5,284.32
4.8
save this file now in the past when we
5,287.139
4.56
use csvs or text files I had to do the
5,289.12
4.559
file opening I had to do the file
5,291.699
4.081
writing maybe even the closing I don't
5,293.679
3.601
need to do that with this Library the
5,295.78
3.72
pillow library takes care of the opening
5,297.28
4.5
the closing and the saving for me by
5,299.5
4.56
just calling save I'm going to call this
5,301.78
3.899
save function and just to leave space
5,304.06
3.48
because I have a number of arguments to
5,305.679
3.241
pass I'm going to move to another line
5,307.54
3.72
so it fits I'm going to pass in the name
5,308.92
4.88
of the file that I want to create
5,311.26
5.04
costume.jif that will be the name of my
5,313.8
4.72
animated gif I'm going to tell this
5,316.3
5.7
library to save all of the frames that I
5,318.52
5.52
pass to it so the First costume the
5,322
3.659
second costume and even more if I gave
5,324.04
4.26
them I'm going to then append to this
5,325.659
6.361
first image the image is zero uh the
5,328.3
5.1
following images
5,332.02
3.9
equals this list of images and this is a
5,333.4
4.5
bit clever but I'm going to do this I
5,335.92
4.14
want to append the next image there
5,337.9
5.339
images one and now I want to specify a
5,340.06
5.52
duration of 200 milliseconds for each of
5,343.239
4.681
these frames and I want this to Loop
5,345.58
4.8
forever and if you specify Loop equals
5,347.92
5.04
zero that is Time Zero it means it's
5,350.38
4.799
just not going to Loop a finite number
5,352.96
4.199
of times but an infinite number of times
5,355.179
4.761
instead and I need to do one other thing
5,357.159
6.961
recall that sys.org V contains not just
5,359.94
6.219
the words I typed after my program's
5,364.12
4.86
name but what else does sys.org v
5,366.159
5.161
contain if you think back to our
5,368.98
4.679
discussion of command line arguments
5,371.32
5.64
what else is insist.orgv besides the
5,373.659
5.401
words I'm about to type like costume one
5,376.96
5.88
dot GIF and costume two yeah so we'll
5,379.06
5.76
actually get in that their original name
5,382.84
4.44
of the program we want to run the
5,384.82
4.56
costume set pie indeed we'll get the
5,387.28
4.32
original name of the program costumes.pi
5,389.38
3.359
in this case which is not a gif
5,391.6
3.9
obviously so remember that using slices
5,392.739
5.761
in Python we can do this if sys.orgv is
5,395.5
5.28
a list and we want to get a slice of
5,398.5
3.84
that list everything after the first
5,400.78
4.68
element we can do one colon which says
5,402.34
6.42
start at location one not zero and take
5,405.46
5.16
a slice all the way to the end so give
5,408.76
4.08
me everything except the first thing in
5,410.62
4.019
that list which to McKenzie's point is
5,412.84
3.839
the name of the program
5,414.639
4.441
now if I haven't made any mistakes let's
5,416.679
4.56
see what happens I'm going to run python
5,419.08
4.139
of costumes.pi and now I'm going to
5,421.239
3.781
specify the two images that I want to
5,423.219
3.44
animate so
5,425.02
5.28
costume1.jif and costume2.gif
5,426.659
5.98
what is the code now going to do well to
5,430.3
4.439
recap we're using the sys library to
5,432.639
3.6
access those command line arguments
5,434.739
3.661
we're using the pillow library to treat
5,436.239
4.561
those files as images and with all the
5,438.4
3.6
functionality that comes with that
5,440.8
3.72
Library I'm using this images list just
5,442
4.679
to accumulate all of these images one at
5,444.52
4.5
a time from the command line and in line
5,446.679
4.56
seven through nine I'm just using a loop
5,449.02
4.26
to iterate over all of them and just add
5,451.239
4.321
them to this list after opening them
5,453.28
4.68