Putty wrote:

> I'm porting a program a friend wrote in C over to Python and I've run
> into a little hang-up.  The C program writes characters out to a file.
> I'm 99% sure that a conversion is going on here as well.  I know for a
> fact that it's taking a number and turning it into a character.

that's what fputc does, of course -- it takes an integer and writes
it as a character to the given stream.

    f = fopen(filename, "w");
    fputc(c, f);
    fclose(f)

becomes

    f = open(filename, "w")
    f.write(chr(value))
    f.close()

</F>



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to