我正在用 wxPython 制作一个 twitter python 客户端,但只有一件事不起作用。请帮忙。这是代码的那一部分:
getstatus = twitter.Api()
pullstatus=wx.TextEntryDialog(panel, "Type which users to pull a status from.", 'Twitter Post Reader', 'Person')
if pullstatus.ShowModal()==wx.ID_OK:
puller=pullstatus.GetValue()
get = getstatus.GetUserTimeline(puller)
wx.StaticText(panel, -1, get, (200,450))
只有在最后一行,当我输入变量get
时,它才会引发错误。编辑:我修复了代码。这是我所做的:
getstatus = twitter.Api()
pullstatus=wx.TextEntryDialog(panel, "Type which users to pull a status from.", 'Twitter Post Reader', 'Person')
if pullstatus.ShowModal()==wx.ID_OK:
puller=pullstatus.GetValue()
statusArray = getstatus.GetUserTimeline(puller)
str_list = []
for s in statusArray:
str_list.append(s.text)
wx.StaticsText(panel, -1, ''.join(str_list), (10,300))