Slicer opens the the .py file in the program that is specified in operating system settings. If you want to use a different program (e.g., because when you installed Python you chose to associate .py files with the Python launcher) then you can specify an editor in the Slicer application settings. This feature is only available in latest Slicer Preview Releases.