scripts

My personal collection of scripts
git clone git://src.gearsix.net/scriptsscripts.zip
Log | Files | Refs | Atom | README | LICENSE

d2h.py (raw) (286B)


   1 #!/usr/bin/env python3
   2 # decimal to hex
   3 # description: convert decimal numbers to hexadecimal
   4 
   5 while (True):
   6     d = input('> ')
   7     if d.isdigit():
   8         print(hex(int(d)))
   9     elif d == 'q' or d == 'quit' or d == 'exit':
  10         exit()
  11     else:
  12         print(d, 'is not a number')