根据pyenchantdocumentation用法如下:, 在
>> import wx
>> from enchant.checker import SpellChecker
>> from enchant.checker.wxSpellCheckerDialog import wxSpellCheckerDialog
>>
>> app = wx.PySimpleApp()
>> text = "This is sme text with a fw speling errors in it. Here are a fw more to tst it ut."
>> dlg = wxSpellCheckerDialog(None,-1,"")
>> chkr = SpellChecker("en_US",text)
>> dlg.SetSpellChecker(chkr)
>> dlg.Show()
>> app.MainLoop()
这将打开拼写更正对话框。在
那么我怎样才能得到修改过的文本呢?在
编辑1:
文本=chkr.get_文本()返回已更正的文本。但我有以下错误。在
PyAssertionError at/测验/提交/ C++断言“WxTo::ISMIN())在.\SRC\MSW\\失败evtloop.cpp(244)在wxEventLoop::Dispatch()中:只有主线程可以处理Windows消息
这是我实现的代码
^{pr2}$
我确信您调用
chkr.getText()
,它返回正确的文本。在相关问题 更多 >
编程相关推荐