[問題] 請問編輯器對物件的提示功能
我目前是用 Visual Studio Code + Python 的擴充功能當編輯器
在呼叫一些函式或是建立物件的時候都有提示出現(IntelliSense)
可是在某些狀況下卻沒有任何提示:
1 import wx
2
3 class Example(wx.Frame):
4 self.toolbar = self.CreateToolBar()
5 self.toolbar.AddTool(wx.ID_UNDO, '', wx.Bitmap('edit-undo.png'))
第四行的 CreateToolBar() 都還有正確的提示
(CreateToolBar() 會 return 一個 wx.TooBar 的物件)
可是第五行的 AddTool() 就不會有任何提示
可是如果換個寫法:
1 import wx
2
3 class Example(wx.Frame):
4 toolbar1 = wx.ToolBar(self)
5 toolbar1.AddTool(wx.ID_UNDO, '', wx.Bitmap('edit-undo.png'))
這樣就都會正確提示
然後試過用 PyCharm 也是一樣
是因為編輯器認不得 CreateToolBar() 會 return 一個 wx.ToolBar 的物件嗎?
所以它也不懂 self.toolbar,也不懂物件內部的屬性或方法?
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 219.85.16.239
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1500634601.A.F7B.html
推
07/21 19:38, , 1F
07/21 19:38, 1F
→
07/22 01:14, , 2F
07/22 01:14, 2F
※ 編輯: LeonH (219.85.16.239), 07/22/2017 01:14:48
→
07/23 14:26, , 3F
07/23 14:26, 3F
→
07/23 14:27, , 4F
07/23 14:27, 4F
→
07/23 14:35, , 5F
07/23 14:35, 5F
→
07/24 12:54, , 6F
07/24 12:54, 6F
→
07/24 12:55, , 7F
07/24 12:55, 7F