local interpreter remote machines

hokieghal99 hokiegal99 at hotmail.com
Mon Jan 5 22:17:58 CET 2004


This may not be possible, but I thought I'd ask anyway. Could I get the 
below code to run on a Python server where other machines would connect 
to it (say thru the Web) and get details of *their* system instead of 
the system details of the machine that the interpreter is running on? 
Any ideas?

Thanks!!!

import os
import socket

x = os.uname()
y = socket.gethostbyaddr(x[1])
print
print "This is the connecting machine's os:", x[0]
print "This is the connecting machine's os version:", x[2]
print "This is the connecting machine's IP address:", y[2]
print




More information about the Python-list mailing list