如何在Django中使用wxSpellCheckerDialog?

2024-09-27 00:20:22 发布

您现在位置:Python中文网/ 问答频道 /正文

根据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}$

Tags: textfrom文本importappcheckeritenchant

热门问题