+ 3 - 6 | § ¶iprint - Andrew "Tridge" Tridgell's iprint in Python
"""
This function does the coversion from integer to binary
"""
bin = ''
while dec:
bin = (dec % 2 and '1' or '0') + bin
dec = long(dec/2)
return bin or '0'
text = ''
while len(sys.argv) > 1 and x < len(sys.argv):
text += sys.argv[x]
x += 1
print ord(x), "\t", hex(ord(x)), "\t", oct(ord(x)), "\t", toBinary(ord(x)), "\t", x
print "\n"
Keywords: iprint,Python,Tridge,Binary,Decimal,Hex,Octal
