Let’s make the simplest app to watch videos with tkinter. It is very basic, but in a next future we could make it nicer and with more features.
Here is the code.
import tkinter as tk import os, glob def start_video(event): ind = listbox.curselection() movie_name = listbox.get(ind) os.startfile(movie_name) root = tk.Tk() listbox = tk.Listbox(root) listbox.pack() mp4 = glob.glob("*mp4") for movie in mp4: listbox.insert(tk.END, movie) listbox.bind("<Double-Button>", start_video) root.mainloop()
Live coding video about tkinter video app
A new post about this topic
Subscribe to the newsletter for updates
Tkinter templates
My youtube channel
Twitter: @pythonprogrammi - python_pygame