• Login
Community
  • Login

Save as [type] lacks an option for .py (python) file

Scheduled Pinned Locked Moved General Discussion
save aspythonsave as
9 Posts 5 Posters 3.6k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M
    Marc Hankin
    last edited by Marc Hankin Jun 28, 2023, 3:37 PM Jun 28, 2023, 3:35 PM

    When I try to save a script I coded in Python, the drop-down menu for Save as [file type] lacks the option to save as .py (Python). The following is an image that is a composite of 3 images (of the drop-down list) to show that the option to save as a .py file is missing:

    2023-06-28_17-06-40  Missing optioin to save file as .py for python  .png

    I’d appreciate any suggestions about how to fix that.

    Thanks,
    Marc

    p.s. My debug info is as follows:

    Notepad++ v8.5.3 (64-bit)
    Build time : May 15 2023 - 06:09:36
    Path : C:\Program Files\Notepad++\notepad++.exe
    Command Line : “E:\Apps\UtilitiesByMarc\Vbs.RarTo__Archive_Nu.vbs”
    Admin mode : OFF
    Local Conf mode : OFF
    Cloud Config : OFF
    OS Name : Windows 10 Pro (64-bit)
    OS Version : 22H2
    OS Build : 19045.3086
    Current ANSI codepage : 1252
    Plugins :
    MenuIcons (2)
    mimeTools (2.9)
    NotepadStarterPlugin (2.3.3)
    Npp-Highlighter (1.0.0.1)
    NppBplistPlugin (1.3)
    NppConverter (4.5)
    NppExec (0.8.2)
    NppExport (0.4)
    NppMenuSearch (0.9.6)
    NppPluginDemo (4.3)
    NppPluginTemplate (4.3)
    NppRegExTractorPlugin (2.1)
    NppSnippets (1.7.1)
    NppTaskList (2.5)
    NppXmlTreeviewPlugin (2)
    pork2sausage (2.3)
    PreviewHTML (1.3.2)
    Python Indent (1.0.0.4)
    PythonScript (2)
    QuickText (0.2.5.1)
    RandomValuesNppPlugin (0.2.1)
    RegexTrainer (1)
    Remove Duplicate Lines (1.3)
    XMLTools (3.1.1.13)
    _CustomizeToolbar (5.3)

    E P 2 Replies Last reply Jun 28, 2023, 3:50 PM Reply Quote 1
    • E
      Ekopalypse @Marc Hankin
      last edited by Jun 28, 2023, 3:50 PM

      @Marc-Hankin

      That is indeed strange.

      3b2c0886-087c-4847-addc-7b75173fc9e3-image.png

      What does the status bar say in the first field when you have a Python file open?

      1 Reply Last reply Reply Quote 4
      • P
        PeterJones @Marc Hankin
        last edited by Jun 28, 2023, 5:20 PM

        @Marc-Hankin said in Save as [type] lacks an option for .py (python) file:

        I’d appreciate any suggestions about how to fix that.

        Fix langs.xml (for you, it’s in %AppData%\Notepad++\langs.xml 🛈, since your DebugInfo shows a normal installation). You can compare to C:\Program Files\Notepad++\langs.model.xml to see what the “python” entry should look like.

        Details: Notepad++ creates the SaveAs-type list from langs.xml, and lists the languages in the same order that they are found in langs.xml (hence they aren’t always alphabetical). If you have any Settings > Style Configurator > Language:Python entries in the User ext block, those will be included in the list of extensions filtered in the SaveAs-type list (hence @Ekopalypse’s shows some extra extensions compared to the two default *.py;*.pyw that are normally shown)
        10b4522b-62f8-42cc-b91a-da3e486bc29d-image.png

        M D 2 Replies Last reply Jul 1, 2023, 8:49 AM Reply Quote 4
        • M
          Marc Hankin @PeterJones
          last edited by Jul 1, 2023, 8:49 AM

          @PeterJones @Ekopalypse When I opened an existing Python file, the following was in the status line:

          “Python file length:10,816 lines:351 Ln:1 Col:1 Pos:1 Windows (CR IF) UTF-8 INS”

          By the way, this was after I had [1] compared the langs.xml files, [2] found a lot of differences, [3] but found that the Python language section appeared in my user XML too, and [4] impetuously copied everything from the C:\Program Files\Notepad++\langs.model.xml into my user XML, C:\Users\marc\AppData\Roaming\Notepad++\langs.xml, so that the two files are now identical. But Python still does not appear as an option when I am saving a new file.

          P 1 Reply Last reply Jul 1, 2023, 3:39 PM Reply Quote 0
          • P
            PeterJones @Marc Hankin
            last edited by Jul 1, 2023, 3:39 PM

            @Marc-Hankin said in Save as [type] lacks an option for .py (python) file:

            But Python still does not appear as an option when I am saving a new file

            Assuming you restarted Notepad++ after making the changes to langs.xml (since it cannot know about the changes until it restarts), my next suggestion would be to download the “portable zip” from the official download site, unzip it into a known directory (maybe onto your desktop); exit your normal Notepad++ and run from the portable directory. See if that one works.

            If it does, then my next guess would be that one of your plugins is somehow messing with that list. Try running your installed notepad++ with command line argument -noPlugin , which will run without any plugins; if that causes your normal installed Notepad++ to give Python as a possible choice, then it’s definitely one of your plugins, and you can try to disable one plugin at a time to find the culprit. (The -noPlugin and one-plugin-at-a-time procedures are described in this FAQ section.)

            1 Reply Last reply Reply Quote 2
            • W
              wonkawilly
              last edited by wonkawilly Jul 2, 2023, 2:26 PM Jul 2, 2023, 2:25 PM

              I have Npp 853 portable 32bit and python file type is present into the menu with two file estensions.

              Screenshot follows

              a4c177b6-611f-49d3-b013-13d53205aaf0-image.png

              Not sure, but maybe original files got corrupted for some reason. Perhaps you could download a portable version of npp, extract from the compressed archive the files that are not working and replace the originals with the new ones?

              1 Reply Last reply Reply Quote 0
              • D
                deleelee @PeterJones
                last edited by Aug 19, 2023, 8:27 AM

                @PeterJones said in Save as [type] lacks an option for .py (python) file:

                Notepad++ creates the SaveAs-type list from langs.xml

                I wish we could add our own entries to it. I have custom extensions I’d like to have in the Save As list eg: XYplorer and AutoHotkey.

                P 1 Reply Last reply Aug 19, 2023, 3:17 PM Reply Quote 0
                • P
                  PeterJones @deleelee
                  last edited by Aug 19, 2023, 3:17 PM

                  @deleelee said in Save as [type] lacks an option for .py (python) file:

                  @PeterJones said in Save as [type] lacks an option for .py (python) file:

                  Notepad++ creates the SaveAs-type list from langs.xml

                  I wish we could add our own entries to it. I have custom extensions I’d like to have in the Save As list eg: XYplorer and AutoHotkey.

                  That’s a great idea. The natural implementation would be for Notepad++ to include the extensions listed in all loaded User Defined Languages in addition to the native language file extensions (and the user-supplied “User ext.” for those native langauges) that it already lists. Unfortunately, it doesn’t do that, and my request from Jan 2022 has sat idle without any developer taking it on. Maybe if someone (hint hint) were to go say that they really wanted this feature, too, it might encourage a developer to gain an interest in it.

                  D 1 Reply Last reply Aug 20, 2023, 4:43 AM Reply Quote 0
                  • D
                    deleelee @PeterJones
                    last edited by Aug 20, 2023, 4:43 AM

                    @PeterJones said in Save as [type] lacks an option for .py (python) file:

                    The natural implementation would be for Notepad++ to include the extensions listed in all loaded User Defined Languages in addition to the native language file extensions

                    I agree 100% and have added my support to your request. I also think we should be able to add file extensions for languages we don’t have UDLs for, and I’ve mentioned that as well.

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    The Community of users of the Notepad++ text editor.
                    Powered by NodeBB | Contributors