Reputation: 24131
I have downloaded some software, which is controlled with a Lua script. However, I want to be able to control it with a Python script. Luckily, the software comes a Python module which can be imported, and then a Python API which can be used to control the software.
What I don't understand, is how the data is transferred between my Python script, and the software running on my machine. The software very vaguely describes it as using sockets and TCP/IP to transfer data. However, I do not understand what this means.
From my knowledge of TCP/IP, it is used to send and receive data from websites. So, my web browser sends a TCP/IP command to a web server, which then responds by sending the requested data back to my computer.
So does this mean that when I run the Python script and receive data from this software, then I am sending the request over the internet, which has to come all the way back to my computer? Or is it just that everything is running locally on my machine, and TCP/IP is just some format which is used to transfer the data between two different programs which are running?
Thanks!
Upvotes: 0
Views: 570
Reputation: 22992
Your software may be running as a server and is listening to a given port (like a web server), and the Python script may be running as a client. They may use RPC (Remote Procedure Call). You are not sending requests to the Internet, but in localhost. See: https://docs.python.org/3.6/library/xmlrpc.html
Upvotes: 1
Reputation: 832
TCP/IP is protocol to send requests over the internet. Read more here.
Upvotes: 0