Romain> Assuming fsock is a File objet, when I do: Romain> var = fsock.read(4) Romain> I get a String. I'd like to convert it into an integer. Check out the struct module.