前提・実現したいこと
Python3.6.5でGUIを扱う勉強をしています
VisualStudioCodeを使用しているのですが、例として載っていたコードをコピペしただけなのにVisualStudioCodeでエラーが出ます
実行してもエラーは出ません
エディターの問題なのかコードの問題かわからないので教えてください
よろしくおねがいします
発生している問題・エラーメッセージ
{ "resource": "/C:/Users/PC_User/Desktop/Python_GUI/Python_GUI_1.py", "owner": "python", "code": "E1101", "severity": 8, "message": "E1101:Module 'wx' has no 'Frame' member", "source": "pylint", "startLineNumber": 5, "startColumn": 9, "endLineNumber": 5, "endColumn": 9 }
{ "resource": "/C:/Users/PC_User/Desktop/Python_GUI/Python_GUI_1.py", "owner": "python", "code": "E1101", "severity": 8, "message": "E1101:Module 'wx' has no 'ID_ANY' member", "source": "pylint", "startLineNumber": 5, "startColumn": 24, "endLineNumber": 5, "endColumn": 24 }
該当のソースコード
Python3.6.5
1import wx 2 3application = wx.App() 4 5frame = wx.Frame(None, wx.ID_ANY, 'テストフレーム' , size=(300,300)) 6frame.Show() 7 8application.MainLoop()
補足情報(FW/ツールのバージョンなど)
Windows10 Pro 1803
Python 3.6.5
VisualStudioCode 1.24.1
###追記
教えてもらい以下の設定を追記したところ新たな注意(?)がたくさん出たので解決方法を教えてください
よろしくおねがいします
wxのほうは「エラー」としてカウントされていましたが、今回は「情報」としてカウントされています
VisualStudioCode
1"python.linting.pylintArgs": ["--extension-pkg-whitelist=wx"]
以下、注意内容
{ "resource": "/C:/Users/PC_User/Desktop/Python_GUI/Python_GUI_1.py", "owner": "python", "code": "C0103", "severity": 2, "message": "C0103:Module name \"Python_GUI_1\" doesn't conform to snake_case naming style", "source": "pylint", "startLineNumber": 1, "startColumn": 1, "endLineNumber": 1, "endColumn": 1 }
{ "resource": "/C:/Users/PC_User/Desktop/Python_GUI/Python_GUI_1.py", "owner": "python", "code": "C0111", "severity": 2, "message": "C0111:Missing module docstring", "source": "pylint", "startLineNumber": 1, "startColumn": 1, "endLineNumber": 1, "endColumn": 1 }
{ "resource": "/C:/Users/PC_User/Desktop/Python_GUI/Python_GUI_1.py", "owner": "python", "code": "C0103", "severity": 2, "message": "C0103:Constant name \"application\" doesn't conform to UPPER_CASE naming style", "source": "pylint", "startLineNumber": 3, "startColumn": 1, "endLineNumber": 3, "endColumn": 1 }
{ "resource": "/C:/Users/PC_User/Desktop/Python_GUI/Python_GUI_1.py", "owner": "python", "code": "C0326", "severity": 2, "message": "C0326:No space allowed before comma", "source": "pylint", "startLineNumber": 5, "startColumn": 1, "endLineNumber": 5, "endColumn": 1 }
{ "resource": "/C:/Users/PC_User/Desktop/Python_GUI/Python_GUI_1.py", "owner": "python", "code": "C0326", "severity": 2, "message": "C0326:Exactly one space required after comma", "source": "pylint", "startLineNumber": 5, "startColumn": 1, "endLineNumber": 5, "endColumn": 1 }
{ "resource": "/C:/Users/PC_User/Desktop/Python_GUI/Python_GUI_1.py", "owner": "python", "code": "C0103", "severity": 2, "message": "C0103:Constant name \"frame\" doesn't conform to UPPER_CASE naming style", "source": "pylint", "startLineNumber": 5, "startColumn": 1, "endLineNumber": 5, "endColumn": 1 }
{ "resource": "/C:/Users/PC_User/Desktop/Python_GUI/Python_GUI_1.py", "owner": "python", "code": "C0304", "severity": 2, "message": "C0304:Final newline missing", "source": "pylint", "startLineNumber": 8, "startColumn": 1, "endLineNumber": 8, "endColumn": 1 }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/07/24 12:43
2018/07/24 13:05 編集
2018/07/24 13:03
2018/07/27 04:27
2018/07/27 09:54