HOW TO
Instructions provided describe how to enable color highlighting of Python toolboxes (PYT files) in the IDLE IDE.
Python toolboxes (.pyt) are geoprocessing toolboxes that are created entirely in Python. Although these tools are recognized by ArcGIS software as Python scripts, they may or may not be treated as Python scripts within various Python IDEs. To ensure that these files are recognized by a Python IDE it may be necessary to include the .pyt extension in the settings for the Python IDE.
Code:
def ispythonsource(self, filename):
if not filename or os.path.isdir(filename):
return True
base, ext = os.path.splitext(os.path.basename(filename))
if os.path.normcase(ext) in (".py", ".pyw")
return True
Code:
def ispythonsource(self, filename):
if not filename or os.path.isdir(filename):
return True
base, ext = os.path.splitext(os.path.basename(filename))
if os.path.normcase(ext) in (".py", ".pyw", ".pyt")
return True
Get help from ArcGIS experts
Download the Esri Support App