Skip to content, Skip to search

Changes

Script Parameters

185 bytes removed, 05:13, 29 August 2017
Basic syntax: Embed source code from github
For example, if we look at the [https://github.com/scijava/scripting-jython/blob/scripting-jython-0.2.0/src/main/resources/script_templates/Python/Greeting.py Greeting.py] [[Script_Templates|template]] supplied with Fiji:
<source lang{{GitHubEmbed| org ="python">scijava#@String name#@output String greeting # A Jython script with parameters.# It is the duty of the | repo = scripting framework to harvest-jython# the 'name' parameter from the user, and then display# the 'greeting' output parameter, based on its type| path = src/main/resources/script_templates/Intro/Greeting.py greeting = "Hello, " + name + "!"</source>}}
We see that an input parameter <code>name</code> of type <code>String</code> is declared. <code>@Parameters</code> are handled automatically by the framework; if we run this script when the User Interface is available (e.g. from the script editor), the <code>name</code> parameter will automatically be harvested via a pop-up dialog:
Bureaucrat, emailconfirmed, incoming, administrator, uploaders
716
edits