init¶
init connects your plugin to AnyWave. It must be the first call of the package.
import sys
import anywave as aw
aw.init(sys.argv)
Warning
Always pass sys.argv, exactly as it is. AnyWave starts the script with the information needed to connect to
your plugin (the identifier of the plugin and the port of AnyWave): init expects the script name and these two
numbers, nothing else, and raises a ValueError when it receives a different number of arguments.
init returns nothing and does not read the settings of the plugin. Call get_props for them:
aw.init(sys.argv)
props = aw.get_props()
print(props['data_path'])
After init, the module has the variables anywave.pid and anywave.port, which the other functions use. You never
need to set them yourself.
In a debug session¶
When the script does not run as a plugin of AnyWave, call debug_connect instead of init, see
Debug a Python plugin in your IDE.