前提・実現したいこと
Python tkinter などを使ってアプリケーションを作っています
クラスの使い方に関する構文エラーだと思うのですが、、、
次のエラーメッセージの意味が分からないので質問したいです
どのような感じのエラーか確証が欲しいですmm
発生している問題・エラーメッセージ
エラーメッセージ #def mp3(self) のdefのところに波線エラー An attribute defined in tk_ydl line 18 hides this methodpylint(method-hidden)
該当のソースコード
ソースコード from __future__ import unicode_literals import tkinter as tk import youtube_dl class Application(tk.Frame): def __init__(self, master=None): super().__init__(master) self.pack() self.create_widgets() def create_widgets(self): #MP4 self.hi_there = tk.Button(self) self.hi_there["text"] = "MP4" self.hi_there["command"] = self.mp4 self.hi_there.pack(side="top") # MP3 self.mp3 = tk.Button(self) ######Line18 self.mp3["text"] = "MP3" self.mp3["command"] = self.mp3 self.mp3.pack(side="top") #Quiet self.quit = tk.Button(self, text="QUIT", fg="red",command=root.destroy) self.quit.pack(side="bottom") def mp4(self): URL = input("URL:\n") ydl_opts = {} with youtube_dl.YoutubeDL(ydl_opts) as ydl: ydl.download([str(URL)]) def mp3(self): URL = input("URL:\n") ydl_opts = { 'format': 'bestaudio/best', 'postprocessors': [{ 'key': 'FFmpegExtractAudio', 'preferredcodec': 'mp3', 'preferredquality': '192', }], } with youtube_dl.YoutubeDL(ydl_opts) as ydl: ydl.download([URL]) root = tk.Tk() app = Application(master=root) app.mainloop()
試したこと
(method-hidden) python というキーワードで検索してみましたが
ピンポイントでわかりませんでした
補足情報(FW/ツールのバージョンなど)
言語: python3
エディタ :VScode
ツール : Anacondaなど
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。