3.5 | 2 Votes
What is a PYT file?
ESRI ArcGIS is a mapping and geoanalysis application that allows users to import, edit, annotate, analyze, and otherwise manipulate geographic data. To help them manipulate data, ArcGIS users can access and create toolboxes that contain a collection of related GIS tools. Advanced users can code their own toolboxes and custom tools using the Python programming language. These toolboxes are saved as PYT files.
How to create a PYT file in ArcGIS
To create a new PYT file in ArcGIS:
- In the Catalog pane, select Toolboxes.
- Select New Python Toolbox.
- Name and save your PYT file.
Each PYT file is created from the same template, which uses the Toolbox and Tool classes to define the toolbox's name and included tools. Users can add any number of tools to their PYT file, by adding additional instances of the Tool class.
How to open a PYT file
You can open and edit a PYT file in any text or source code editor. Source code editors, such as Microsoft Visual Studio Code, GitHub Atom, and JetBrains PyCharm, contain helpful syntax-highlighting and code-editing tools that make reviewing and editing PYT files easier.
To import a PYT file into ESRI ArcGIS, create a new Python toolbox in ArcGIS (using the instructions above). Then, copy your PYT file's content into your new Python toolbox and save that toolbox.