test pattern file utility

This commit is contained in:
Max 2018-04-13 09:09:34 -04:00
parent a9fc0c206a
commit 3c50b3c54b
1 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,25 @@
#! /usr/bin/env python
"""
utility program to make binary symbol files
reads source file (stdin); writes binary file to stdout
"""
import sys
s = sys.stdin.read()
s= s.replace(' ', '')
s= s.replace('\n', '')
s = s.strip()
dibits = ''
while s:
s0 = int(s[0], 16)
s = s[1:]
dibits += chr(s0>>2)
dibits += chr(s0&3)
sys.stdout.write(dibits)