Created
August 7, 2014 18:25
-
-
Save ghisprince/d3d4123985ffea996781 to your computer and use it in GitHub Desktop.
pretty print table's fields
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
import arcpy | |
def pprint_fields(table): | |
""" pretty print table's fields and their properties """ | |
def _print(l): | |
print("".join(["{:>12}".format(i) for i in l])) | |
atts = ['name', 'aliasName', 'type', 'baseName', 'domain', | |
'editable', 'isNullable', 'length', 'precision', | |
'required', 'scale',] | |
_print(atts) | |
for f in arcpy.ListFields(table): | |
_print(["{:>12}".format(getattr(f, i)) for i in atts]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment