scripts

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

d2h.py (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')