Hilfe!
Verfasst: Montag 30. September 2019, 18:49
Hallo!
Ich wollte mir heute mein Youtube Converter Help Tool GUI "fähig" machen, weshalb ich mit Tkinter begonnen hab.
Der code sieht folgend aus :
from tkinter import *
import os
import subprocess
def comdm4a():
command=os.system('powershell -command youtube-dl -f m4a' + link)
def comdmp4():
command=os.system('powershell -command youtube-dl -f m4a' + link)
def close_window():
window.destroy()
window = Tk()
window.configure(background='black')
window.title("YOUTUBE-DL HELP TOOL MADE BY D3US3X")
Label(window, text='YOUTUBE-DL HELP TOOL MADE BY D3US3X', bg='black', fg='white', font='verdana 15 bold') .grid(row=0, column=0, sticky=W)
Label(window, text='Normal Path : C:\ ', bg='black', fg='white', font='verdana 12') .grid(row=1, column=0, sticky=W)
Label(window, text='Type in your YouTube Link : ', bg='black', fg='white', font='verdana 12') .grid(row=2, column=0, sticky=W)
link = Entry(window, width=80, bg='grey')
link.grid(row=3, column=0, sticky=W)
m4a = Button(window, text='Convert to m4a!', command=comdm4a , width=15) .grid(row=4, column=1, sticky=E)
mp4 = Button(window, text='Convert to mp4!', command=comdmp4 , width=15) .grid(row=5, column=1, sticky=E)
qut = Button(window, text='Quit!', command=close_window , width=5) .grid(row=6, column=1, sticky=E)
Label(window, text='YouTube Converter by D3US3x is a help tool, that makes it', bg='black', fg='white', font='verdana 11') .grid(row=4, column=0, sticky=W)
Label(window, text='easier to download YouTube Videos from the YouTube Server.', bg='black', fg='white', font='verdana 11') .grid(row=5, column=0, sticky=W)
Label(window, text='All right are going to the youtube-dl developers.', bg='black', fg='white', font='verdana 11') .grid(row=6, column=0, sticky=W)
window.mainloop()
Wenn ich das ganze aber mache bekomme ich das hier :
Traceback (most recent call last):
File "C:\Users\osu\AppData\Local\Programs\Python\Python37\lib\tkinter\__init__.py", line 1705, in __call__
return self.func(*args)
File ".\YOUTUBE-CONVERTER.py", line 6, in comdm4a
command=os.system('powershell -command youtube-dl -f m4a' + link)
TypeError: can only concatenate str (not "Entry") to str
Ich wollte mir heute mein Youtube Converter Help Tool GUI "fähig" machen, weshalb ich mit Tkinter begonnen hab.
Der code sieht folgend aus :
from tkinter import *
import os
import subprocess
def comdm4a():
command=os.system('powershell -command youtube-dl -f m4a' + link)
def comdmp4():
command=os.system('powershell -command youtube-dl -f m4a' + link)
def close_window():
window.destroy()
window = Tk()
window.configure(background='black')
window.title("YOUTUBE-DL HELP TOOL MADE BY D3US3X")
Label(window, text='YOUTUBE-DL HELP TOOL MADE BY D3US3X', bg='black', fg='white', font='verdana 15 bold') .grid(row=0, column=0, sticky=W)
Label(window, text='Normal Path : C:\ ', bg='black', fg='white', font='verdana 12') .grid(row=1, column=0, sticky=W)
Label(window, text='Type in your YouTube Link : ', bg='black', fg='white', font='verdana 12') .grid(row=2, column=0, sticky=W)
link = Entry(window, width=80, bg='grey')
link.grid(row=3, column=0, sticky=W)
m4a = Button(window, text='Convert to m4a!', command=comdm4a , width=15) .grid(row=4, column=1, sticky=E)
mp4 = Button(window, text='Convert to mp4!', command=comdmp4 , width=15) .grid(row=5, column=1, sticky=E)
qut = Button(window, text='Quit!', command=close_window , width=5) .grid(row=6, column=1, sticky=E)
Label(window, text='YouTube Converter by D3US3x is a help tool, that makes it', bg='black', fg='white', font='verdana 11') .grid(row=4, column=0, sticky=W)
Label(window, text='easier to download YouTube Videos from the YouTube Server.', bg='black', fg='white', font='verdana 11') .grid(row=5, column=0, sticky=W)
Label(window, text='All right are going to the youtube-dl developers.', bg='black', fg='white', font='verdana 11') .grid(row=6, column=0, sticky=W)
window.mainloop()
Wenn ich das ganze aber mache bekomme ich das hier :
Traceback (most recent call last):
File "C:\Users\osu\AppData\Local\Programs\Python\Python37\lib\tkinter\__init__.py", line 1705, in __call__
return self.func(*args)
File ".\YOUTUBE-CONVERTER.py", line 6, in comdm4a
command=os.system('powershell -command youtube-dl -f m4a' + link)
TypeError: can only concatenate str (not "Entry") to str