[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
what to send to "listen"
From: |
Eric S. Carlson |
Subject: |
what to send to "listen" |
Date: |
Thu, 17 Aug 2006 08:37:25 -0700 (PDT) |
Hello,
Many apologies for the stupidity of this question, but I need a little more
info about how to use the "listen" command. In particular, I am trying to
get octave to work with python through sockets.
What I can do:
start octave
start listen
in python, I can successfully create a socket connection using:
s = socket(AF_INET, SOCK_STREAM) # create a TCP socket
s.connect((serverHost, serverPort)) # connect to server on the port
What I need:
1. What strings (or whatever) do I send to octave to get it to evaluate
a command
for example:
s.send("x=3") # send something to assign 3 to
variable x
2. Once I get octave to accept my command, how do I retrieve the
response?
data = s.recv(1024) # receive up to 1K bytes
print data
3. If I can successfully communicate, does octave create a workspace so
that after sending a previous definition for x I could use a command like
s.send("y=3*x") and have it make sense to octave?
At this point, I think the issues are what strings/data to send to and
retrieve from octave, and not the use of sockets in python, but I am new at
this as well so I may have this totally screwed up.
I would appreciate any info anyone might provide on these issues.
Thanks,
Eric
--
View this message in context:
http://www.nabble.com/what-to-send-to-%22listen%22-tf2122208.html#a5853772
Sent from the Octave - General forum at Nabble.com.
- what to send to "listen",
Eric S. Carlson <=