views:

59

answers:

1

I am trying to follow the WingIDE tutorial on creating scripts in the IDE.

This following example scripts always throws an error:

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 (most recent call last): File "C:\Wing-pi\Scripts\test.py", line 1, in import wingapi File "C:\Program Files\Development\Wing IDE 3.1\bin\wingapi.py", line 18, in import edit.editor ImportError: No module named edit.editor Process terminated with an exit code of 1

I am launching the script in the Wing IDE as suggested by someone, but I keep getting the same result.

A: 

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.

Tomas Pajonk