Coursework
Coursework
Coursework
Table of Figures
1.1. create_video_list.py
First, as for the “create_video_list.py”, the interface outlined below is fairly rudimentary
and easy-to-use with the required buttons coded in to add available videos to a list area
and play it by pressing the corresponding buttons, the complete functions will be
discussed in the later part of the coursework.
Figure 1 above consists of the code to decorate the appropriate GUI for the module
“create_video_list.py”.
A class named “CreateVideoList” is created to bundle essential functions and data to-
gether. It starts with the constructor “__init__” to initialize necessary objects and
attributes in the process of implementing new functions in the program, in this code, it
has 2 attributes “self” and “window”
Attribute “window” was already assigned with Tk() method from imported module
“video_library” in order to create a window and reduce duplicating code. Its geometry
here will be set to 750x350 with the title “Create Video List”.
The first button labeled “Add Video” is created on the top row, column 0 with the
purpose of adding videos to a list. Next to it is the text “Enter Video Number”, indicating
that user should type in a number in the entry on column 2, the number entered should
match with the video’s one. The video’s information will be displayed in the list area
below the button (list.txt)
The second button labeled “Play Video” is placed on the top rightmost of the GUI with
the purpose of playing the video once the number is entered. The information will
appear in the rectangle text area (video.txt) right below the button.
The third button named “Reset playlist” is placed at the bottom center of the interface,
it will clear all texts that appear on both list area and text area once clicked by the users.
There is a small line of text at the bottom of the GUI popping up whenever one of three
buttons is clicked, informing the user that it has been successfully clicked with no
concerning errors.
1.2. “update_video.py”:
The two lines of code in line 19 and 20 are similar to the previous module’s line 22 and
23 but this time, it will search the desired video for the user to change its rating.
In line 28 to line 35, a new line of text “Enter new rating:” is added to instruct users to
enter the rating of their choice in the entry box right next to it. The rating of the video
will be changed as soon as they enter the correct video’s number and press the “Update
Video” button.
In line 43, a line of text at the left bottom of the GUI will also pop up to inform user that
the rating has been successfully changed based on the user’s input.
In this part, the functionality of both modules will be properly and thoroughly explained and
how they run when the program launches.
2.1. “create_video.py”
On figure 2.1, is the basic GUI of the Create Videos List mode. All the buttons are all
placed in relatively distant position for the user to easily figure where to click which
button. The square box on the left of the interface is the playlist that the video’s name
and its information added by the user will appear, the rectangle box on the right will
display the corresponding video’s information with more details.
In terms of the function of the “Add Videos” button, for instance, on figure 2.1, when an
user enters number “01” in the entry box, the system will find the corresponding video
based on the number and display its name and information in the playlist, in this case,
video “01 Tom and Jerry – Fred Quimby ****” has been added to the playlist. A line of
the bottom of the GUI telling “Video 01 has been added to the list” to the user, meaning
the video is available and added to the playlist.
Conclusion
In summary, the program is a simplified video player with the ability to play video, allow users
to check available videos, create a video list with the inclusion of those videos. Currently, I have
only implemented the ability to insert videos in a box to create a video list, play it and clear all
the videos in the list, and allow users to change the rating of the entered video.