Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This depends on what sort of application you are wrapping and on how your GUI options translate into application commands. But you have two goals here:</p> <ol> <li><p>Writing a wrapper to allow you to read your program's output and provide it input.</p></li> <li><p>Making a web-server to receive GUI events and convert them to commands to pass to your "wrapper"</p></li> </ol> <p>I have done something like what you need to do.</p> <ol> <li><p>Essentially you need to turn socket streams into discreet commands. The defacto tool for this is <a href="http://en.wikipedia.org/wiki/Expect" rel="nofollow">expect</a>, and any of it's wrappers (I've used <a href="http://www.noah.org/wiki/pexpect" rel="nofollow">pexpect</a>, the Python wrapper, and had a good experience with it).</p></li> <li><p>This part might not be simple. The problem is that your underlying program is persistently running, and so your web-server should be statefull to know about the program across requests. The other option is for your web-server to simply re-attach to the process and issue it commands, and send back a response when it is encountered in the stdout stream, but you might end up with long response times depending on how fast the program is. Also there is the mismatch that AJAX requests are asynchronous, while your underlying program is synchronous. So yes, this can get quite complex. It really depends on your program. If you could add some details about what the program and the GUI are like, it'd help.</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload