Skip to content

Instantly share code, notes, and snippets.

@zzl0
Created November 5, 2014 09:11
Show Gist options
  • Save zzl0/3b58379c3eb67bf0ac36 to your computer and use it in GitHub Desktop.
Save zzl0/3b58379c3eb67bf0ac36 to your computer and use it in GitHub Desktop.
# coding: utf-8
def get_table_id(tbl_file):
"""
Get table id from .ctb file.
"""
with open(tbl_file, 'rb') as f:
f.seek(-4, 2) # seek to last 4 byte
bytes = f.read(4)
return struct.unpack('<I', bytes)[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment