Add port info
@@ -7,13 +7,12 @@ Both approaches require that the Py4j Python module is installed, see <http://py
### Starting ROBOT from Python
-You can start ROBOT from Python using [`py4j.java_gateway.launch_gateway(...)`](https://www.py4j.org/py4j_java_gateway.html#py4j.java_gateway.launch_gateway). You must specify `jarpath={path/to/robot.jar}` and `classpath=org.obolibrary.robot.PythonOperation` in the args. All other `launch_gateway` args are optional.
+You can start ROBOT from Python using [`py4j.java_gateway.launch_gateway(...)`](https://www.py4j.org/py4j_java_gateway.html#py4j.java_gateway.launch_gateway). You must specify `jarpath={path/to/robot.jar}`, `classpath=org.obolibrary.robot.PythonOperation`, and `port={port}` (e.g., `port=25333`) in the args. All other `launch_gateway` args are optional.
```python
-import py4j
+from py4j.java_gateway import launch_gateway
-py4j.java_gateway.launch_gateway(
- jarpath='path/to/robot.jar',
+launch_gateway(jarpath='bin/robot.jar',
classpath='org.obolibrary.robot.PythonOperation',
port=25333,
die_on_exit=True)
@@ -24,7 +23,7 @@ If you don't specify `die_on_exit=True` in the `launch_gateway` args, the JVM wi
### Starting ROBOT from the Command Line
-If you prefer, you can start ROBOT from the command line with `robot python` and then connect to it from Python. The ROBOT `python` command does not accept any input ontologies and does not produce any outputs. You *cannot* chain this command with other ROBOT commands. To stop the ROBOT process use `Ctrl-C`.
+If you prefer, you can start ROBOT from the command line with `robot python` and then connect to it from Python. The ROBOT `python` command does not accept any input ontologies and does not produce any outputs. You *cannot* chain this command with other ROBOT commands. To stop the ROBOT process use `Ctrl+C`.
By default, the `python` command starts a Py4J gateway server on port `25333` (the Py4J default). To change this, use the `--port` option:
@@ -46,7 +45,6 @@ When you're done you can stop the gateway server from the command line with Ctrl
Once ROBOT has started, you can access any ROBOT methods or objects through the Py4j gateway. Objects must start with `gateway.jvm` followed by the package name (e.g., `org.obolibrary.robot`). For example, use the ROBOT `IOHelper` to load an ontology and print basic information:
```python
-import py4j
from py4j.java_gateway import launch_gateway, JavaGateway
# Not required when running `robot python` from the command line:
