A Python toolbox (.pyt) is an ASCII file that can be edited in any text editor or Python IDE.
To edit a Python toolbox from ArcCatalog or the Catalog window, right-click on the toolbox and click Edit. When your edits are finished, your Python toolbox will be automatically refreshed when the editor is closed. Alternatively, to manually refresh a Python toolbox at any time, right-click on the toolbox and click Refresh.
By default, the Python toolbox will open in NotePad. To control the application in which the .pyt file is opened, first set your Editor in Geoprocessing > Geoprocessing Options.
Solving toolbox and tool errors
A toolbox icon that shows an error icon () indicates a syntax error. To see an explanation of the problem, right-click the toolbox and click Check Syntax. This opens a Python Errors dialog box, which provides the error type and line number. An error such as Parsing error SyntaxError: invalid syntax (line 40), indicates a syntax error on line 40.
A tool icon that has been replaced with an error icon () indicates a failure in the tool. To see an explanation of the problem, right-click the toolbox and click Why. This opens a Python Errors dialog box, which provides the error type and line number. This will cover errors in the tool's __init__, getParameterInfo, or isLicensed methods.