Created
December 19, 2021 04:15
-
-
Save captainGeech42/ba0e642ce2411143d272d673eb7c7081 to your computer and use it in GitHub Desktop.
Take all of the lines, remove leading/trailing whitespace and comments, and stick them in "in"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/miekg/dns/blob/master/types.go#L27 | |
with open("in", "r") as f: | |
lines = [x.strip() for x in f.readlines()] | |
for l in lines: | |
parts = l.split("uint16 = ") | |
type = parts[0].strip()[4:] | |
val = parts[1] | |
print(f"{val}: \"{type}\",") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment