免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4936 | 回复: 1
打印 上一主题 下一主题

TypeError: String or Unicode type required(已解决) [复制链接]

论坛徽章:
4
天蝎座
日期:2013-11-06 11:39:34巳蛇
日期:2014-01-16 16:53:14午马
日期:2014-08-25 21:42:302015年迎新春徽章
日期:2015-03-03 17:21:44
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-08-19 11:55 |只看该作者 |倒序浏览
def OnButton(self, evt):
        dlg = wx.FileDialog(
            self, message="Choose a file",
            defaultDir=os.getcwd(),
            defaultFile="",
            wildcard="",
            style=wx.OPEN | wx.MULTIPLE | wx.CHANGE_DIR
            )

        if dlg.ShowModal() == wx.ID_OK:
            paths = dlg.GetPaths()
            self.cfile.SetValue(paths)

为什么self.cfile.SetValue(paths)执行这条语句就报以下错误
Traceback (most recent call last):
  File "D:\lvxz\TALLYTOIFCSUM\src\TallyToIfcsum.py", line 113, in OnButton
    self.cfile.SetValue(paths)
  File "D:\Python24\Lib\site-packages\wx-2.8-msw-unicode\wx\_controls.py", line 1709, in SetValue
    return _controls_.TextCtrl_SetValue(*args, **kwargs)
TypeError: String or Unicode type required

谢指点,谢谢

paths 返回的是个序列paths [0]

[ 本帖最后由 lvxinzhi 于 2008-8-19 11:57 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2012-07-20 14:16 |只看该作者
TypeError: String or Unicode type required
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP