如何处理没有命名的模块编辑编辑器?

2024-04-26 22:12:17 发布

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

我试图遵循WingIDE tutorial在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)

回溯(最近一次呼叫): 文件“C:\Wing pi\Scripts\测试.py“,第1行,英寸 导入wingapi 文件“C:\Program Files\Development\Wing IDE 3.1\bin”\wingapi.py“,第18行,英寸 进口编辑编辑器 重要错误:没有命名的模块编辑编辑器 进程终止,退出代码为1

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


Tags: 文件pytest脚本app编辑错误编辑器
1条回答
网友
1楼 · 发布于 2024-04-26 22:12:17

答案来自开发Wind IDE的Wingware公司Stephan Deibel的电子邮件。在

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:

除非有Wing sources,否则无法在调试模式下运行脚本。您可以在Wing IDE中很好地启动脚本。在

相关问题 更多 >