Creating a client
Create a client.py
file with the following content:
import tuxedo as t _, _, res = t.tpcall("TOUPPER", "Hello, world!") print(res)
The Tuxedo client code is even simpler: just import the tuxedo
module.
Then, use the synchronous remote procedure (service) call with the tpcall
function and specify that we are calling the TOUPPER
service and the string we want to convert to uppercase.
As a result of the service call, we get all tree values the service returned by using the tpreturn
function. We will learn about each of these in Chapter 5, Developing Servers and Clients, of this book, but right now, we will use just the third one, containing a string converted to uppercase. Therefore, we will use an underscore for the first two values, which is a standard Python way of indicating values that have been ignored.