novice20 17 Junior Poster

Thanks a lot to all those who have been posting reply to my threads and helping me throughout my projcet :) I would love to add reputation points to many, but unfortunately am not getting how to do it on forum :(

TrustyTony commented: You have manners +13
novice20 17 Junior Poster

thanks Grib....

I need to maintain a list of servers that host the software release folders. I need my script to be generic, i.e., it can be run on any of the servers.
I need to check the ip address of the host on which am running the script, and for the servers in list other than my host, i need to do a telnet to connect to it and get the folder,if present do an FTP upload.

I got this Crude method of creating a dummy socket and getting my IP address from ASPN Python cookbook

import socket

s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(('google.com',80))
return s.getsocketname()[0]

and it helped me....

Gribouillis commented: Nice trick ! +4