问一个关于wx.MessageBox的问题。

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

问一个关于wx.MessageBox的问题。

maki-7
我看书上有这么一段代码:
import wx
dlg = wx.MessageBox(None,'hello world!','hello',wx.YES_NO)
re = dlg.ShowModal()
dlg.Destroy()
-------
可我运行的时候,出现:
Traceback (most recent call last):
  File "D:\MessageBox.py", line 2, in <module>
    dlg = wx.MessageBox(None,'hello world!','hello',wx.YES_NO)
  File "D:\Python25\Lib\site-packages\wx- 2.8-msw-unicode\wx\_misc.py", line 493, in MessageBox
    return _misc_.MessageBox(*args, **kwargs)
TypeError: String or Unicode type required
 
请问下这是为什么。谢谢
 

_______________________________________________
python-chinese
Post: send [hidden email]
Subscribe: send subscribe to [hidden email]
Unsubscribe: send unsubscribe to  [hidden email]
Detail Info: http://python.cn/mailman/listinfo/python-chinese
Reply | Threaded
Open this post in threaded view
|

Re: 问一个关于wx.MessageBox的问题。

limodou
2008/1/17 maki <[hidden email]>:

> 我看书上有这么一段代码:
> import wx
> dlg = wx.MessageBox(None,'hello world!','hello',wx.YES_NO)
> re = dlg.ShowModal()
> dlg.Destroy()
> -------
> 可我运行的时候,出现:
> Traceback (most recent call last):
>   File "D:\MessageBox.py", line 2, in <module>
>     dlg = wx.MessageBox(None,'hello world!','hello',wx.YES_NO)
>   File "D:\Python25\Lib\site-packages\wx- 2.8-msw-unicode\wx\_misc.py", line
> 493, in MessageBox
>     return _misc_.MessageBox(*args, **kwargs)
> TypeError: String or Unicode type required
>
> 请问下这是为什么。谢谢
>
参数不对,它第一个不是parent参数,所以第一个不能是None。建议看文档。

--
I like python!
UliPad <<The Python Editor>>: http://code.google.com/p/ulipad/
meide <<wxPython UI module>>: http://code.google.com/p/meide/
My Blog: http://www.donews.net/limodou
_______________________________________________
python-chinese
Post: send [hidden email]
Subscribe: send subscribe to [hidden email]
Unsubscribe: send unsubscribe to  [hidden email]
Detail Info: http://python.cn/mailman/listinfo/python-chinese
Reply | Threaded
Open this post in threaded view
|

Re: 问一个关于wx.MessageBox的问题。

maki-7
看了函�德�明,���}解�Q了,�x�x。

在08-1-18,limodou <[hidden email]> 写道:
2008/1/17 maki <[hidden email]>:

> 我看书上有这么一段代码:
> import wx
> dlg = wx.MessageBox(None,'hello world!','hello',wx.YES_NO)
> re = dlg.ShowModal()
> dlg.Destroy()
> -------
> 可我运行的时候,出现:
> Traceback (most recent call last):
>   File "D:\MessageBox.py", line 2, in <module>
>     dlg = wx.MessageBox(None,'hello world!','hello',wx.YES_NO)
>   File "D:\Python25\Lib\site-packages\wx- 2.8-msw-unicode\wx\_misc.py", line
> 493, in MessageBox
>     return _misc_.MessageBox(*args, **kwargs)
> TypeError: String or Unicode type required
>
> 请问下这是为什么。谢谢
>
参数不对,它第一个不是parent参数,所以第一个不能是None。建议看文档。

--
I like python!
UliPad <<The Python Editor>>: http://code.google.com/p/ulipad/
meide <<wxPython UI module>>: http://code.google.com/p/meide/
My Blog: http://www.donews.net/limodou
_______________________________________________
python-chinese
Post: send [hidden email]
Subscribe: send subscribe to [hidden email]
Unsubscribe: send unsubscribe to  [hidden email]
Detail Info: http://python.cn/mailman/listinfo/python-chinese


_______________________________________________
python-chinese
Post: send [hidden email]
Subscribe: send subscribe to [hidden email]
Unsubscribe: send unsubscribe to  [hidden email]
Detail Info: http://python.cn/mailman/listinfo/python-chinese