Python实操视频下载软件

import tkinter as tk
import subprocess  # 进程
root = tk.Tk()
root.title('视频下载小软件')
root.geometry('400x50+150+150')

key_word = tk.StringVar()


def downLoad():
    link = f'you-get -o video {key_word.get()}'
    subprocess.run(link, shell=True)


def clear():
    # key_word.set('')
    enter.delete(0, 'end')


txt = tk.Label(text='请输入网址:', font=('宋体', 15))
txt.grid(row=0, column=0, padx=15, )
enter = tk.Entry(root, textvariable=key_word)
enter.grid(row=0, column=1)
btn = tk.Button(text='下载', command=downLoad)
btn.grid(row=0, column=2, padx=5)
btn2 = tk.Button(text='清空', command=clear)
btn2.grid(row=0, column=3)
root.mainloop()

你可能感兴趣的:(Python,python,开发语言)