Skip to content

Instantly share code, notes, and snippets.

@tonjadwyer
Last active January 6, 2018 04:42
Show Gist options
  • Save tonjadwyer/78e20355aad5af3c7194599bee5fbcba to your computer and use it in GitHub Desktop.
Save tonjadwyer/78e20355aad5af3c7194599bee5fbcba to your computer and use it in GitHub Desktop.
Pull a field calculator .cal file into a string
def expression_from_cal(infile):
with open(infile, "rb") as data:
text = data.read().decode('utf-16-le')
print_msg(text)
return text.strip()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment