I don't know if you found this example: http://www.daniweb.com/code/snippet285.html
-- > I'm was wanting to format a positive integer in binary, > and not finding it--to my surprise--I rolled my own version. > > Is this already in python, or have I missed it somewhere? > > I have Googled around a bit, and found a few threads on > the subject, but they all seem to fizzle out. > > (e.g. : INPUT 35, OUTPUT "100011" ) -- http://mail.python.org/mailman/listinfo/python-list