0

我正在尝试按照WingIDE 教程在 IDE 中创建脚本。

以下示例脚本总是引发错误:

import wingapi
def test_script(test_str):
  app = wingapi.gApplication
  v = "Product info is: " + str(app.GetProductInfo())
  v += "\nAnd you typed: %s" % test_str
  wingapi.gApplication.ShowMessageDialog("Test Message", v)

Traceback(最近一次调用):文件“C:\Wing-pi\Scripts\test.py”,第 1 行,在 importwingapi 文件“C:\Program Files\Development\Wing IDE 3.1\bin\wingapi.py”中,第 18 行,在 import edit.editor ImportError: No module named edit.editor Process terminate with an exit code of 1

我按照某人的建议在 Wing IDE 中启动脚本,但我一直得到相同的结果。

4

1 回答 1

1

Answer is based on email from Stephan Deibel from the Wingware company that develops Wind IDE.

Scripts are not launched in Wing's debugger. If you're editing them within Wing, they get reloaded as soon as you save and you should be able to use Command By Name in the edit menu to type test-script, which will execute the above script. This is described in more detail on the page you found the example:

You cannot run the script in debug mode unless you have the Wing sources. You can launch the script fine from within the Wing IDE.

于 2009-07-03T09:29:52.907 回答