ArcGIS Pro: Editing Python toolbox opens both my chosen IDE and Notepad

753
4
07-27-2022 09:09 AM
ThomasCrossman
New Contributor III

Vitals:

ArcGIS Pro 2.9.1

Python 3.7.10 64-bit

PyScripter 3.6.4.0 x64

Windows 10 Professional

I have set up PyScripter as my IDE for editing tool scripts and Python toolboxes.  It works great:  no problems with the virtual environment.  The issue I run into is that, when I choose Edit ... from the right-click menu for a Python toolbox or a script tool in the Catalog Pane, the toolbox/script tool is opened for editing simultaneously in both PyScripter (in same PyScripter instance, if already open, which is how it should be) and Notepad.  Edits are possible and saveable in both windows.  I want the scripts to open only in PyScripter.  Is there a setting I am missing somewhere?  Is this a PyScripter problem (I can't see how) or an ArcGIS Pro problem?  I cannot upgrade PyScripter at this time, because I still need the Python 2.7 functionality for managing legacy scripts.  Also, I cannot upgrade to ArcGIS Pro 3.x, as I have active projects using Python.NET, and the pythonnet module does not (yet) officially support .NET 6.  (pythonnet alpha dev adds .NET 6 support, but I am not allowed to use that version for my work.)

I will admit this behavior is more of a major annoyance than a work-halting problem, but it really should not be happening.  Any help would be greatly appreciated.

0 Kudos
4 Replies
RhettZufelt
MVP Frequent Contributor

Don't have PyScripter installed, but if I set Notepad ++ as my pro script editor, it will only open in Notepad ++ when I right click and select edit.

RhettZufelt_0-1658944201894.png

 

R_

 

 

0 Kudos
ThomasCrossman
New Contributor III

@RhettZufelt -- Rats.  Sounds like a PyScripter problem after all ........ indeed, if I switch over to Notepad++ as the editor in ArcGIS Pro, only Notepad++ is opened when I edit a Python toolbox.  Rats again.

Anyone know a solution for this?  I could get by with Notepad++--one of the best text editors out there--I use it every day--but I have gotten rather attached to PyScripter.  It works just the way I like it, and has the value added IDE functionality that I find useful and nothing much more.

0 Kudos
RhettZufelt
MVP Frequent Contributor

wonder if it is related to the default app for that file type.

if you right-click on *.py file and "Open With", mine comes up with python.exe (though I never double click to run code).

wonder if yours has been associated to pyscripter and automatically edits with that as well.

could always associate it with something else and test, then set back if needed.

0 Kudos
WilliamBuerger
Occasional Contributor

I noticed this issue recently myself.  I just gave it a try on a different PC and it originally gave me the windows Open With prompt as I appeared to have not had any association for py files.  I selected SciTE (my preferred editor) and it opened only there.  I then set my script editor in Pro AND set windows to always open py files in SciTE and now, it opens in SciTE AND Notepad.  Removing my script editor didn't change anything.  I than had to edit the Windows Registry to remove my windows file type association.  Now when I edit the script in Pro, it again asks what to edit with but then doesn't open Notepad.  Adding the script editor back doesn't appear to do anything still.  Not sure how setting the windows association to something else causes Pro to additionally open Notepad when not having a windows association works as expected but with the extra step of having to select your editor every time.

0 Kudos