I'm doing a program that uses a socket to send a string from the client to the server and that string is saved in a variable and the following happens:
cmd = sock.recv(1024).decode()
os.system(cmd)
The thing is that I want to send the output to the client, something like this:
output = os.system(cmd)
sock.send(output.encode())
It is not necessary to be with os.system () as long as you can put the output in a variable, thanks.