There exist various solutions to spawn external processes from a script:
GPS.Process
class
GPS.execute_action
.
This action should have an <external>
XML node indicating how to
launch the process
os.popen()
calls
This solution doesn't provide a full interaction with the process, though.
The use of an expect library may be a good solution. There are various python expect libraries that already exist.
These libraries generally try to copy the parameters of the standard file
class. They may fail doing so, as GPS's consoles do not fully emulate all
the primitive functions of that class (there is no file descriptor for
instance).
When possible, it is recommended to use one of the methods above instead.