Adding Modules to a Project

While adding modules to a Jython project can be done by adding files, the New Wizard in the Jython perspective and the Jython Browsing perspective includes commands to create modules from templates that you can specify in the preferences.

  1. In the Jython perspective and the Jython Browsing perspective, the New menu lists the Jython resources that can be added to the Eclipse workspace. Select "Jython Module" from the menu.

  2. The New Jython Module wizard opens. Choose the template that you want to use for the new module. Do not make a selection in the list of templates if you want to start with an empty module.

  3. Press "Next" to move to the page to enter the location and the name of the new module. If you select a folder in the Eclipse workspace before choosing "Jython Module" from the New menu in step 1, that folder will be selected as the parent folder by default.
    Select the desired parent folder and enter the name of the new module. Do not forget to add the .py extension.

  4. Press "Finish". The new module will show up in the Navigator view. An editor will open. The contents of the module will be the selected template.

    (The error marker on the import statement indicates that this example project is not linked to the Jython library.)