So i have a browse button that indicates a path for a download but since it puts out a regular string it won't download since there are backslashes involved and they aren't litteraly interpreted. Edit: I added other parts of my code a bit since some parts weren't really clear.
def browse():
global folder_path
filename = filedialog.askdirectory()
Path = filename
print(Path)
BROWSEbutton = tk.Button(src, text="Browse", font="Courier 12", command=browse).place(x=425,y=0)
def Convert():
try:
video = yt.YouTube(URL.get()).streams.first()
try:
video.download(Path)
print("succesful")
except:
print("error")
msgb.showerror("Error","Invalid Path")
except:
print("error")
msgb.showerror("Error","Invalid URL")
CONVERTbutton = tk.Button(src, text="Convert", font="Courier 12",command=Convert).place(x=243,y=220)