Is there a place to post useful Python scripts for NPP?



  • Just curious if there is a “repository” of some kind for Python scripts (aka cousins of plugins)?



  • @vanowm

    Well, the PythonScript developers sometimes accept scripts for their “Samples” folder that gets installed with PS.

    But otherwise there really isn’t a “place”. You could of course create your own place (e.g. make your own project on github) to store/share yours.



  • Well, I don’t really have much to offer, just made a script that I think some people might find useful (backup files on save, which keeps all previous versions, unlike built-in backup, which overwrites previous backup). Do people share scripts here on the forum?
    I guess it would be more appropriate post it at https://sourceforge.net/p/npppythonscript/discussion/1199074/



  • @vanowm said in Is there a place to post useful Python scripts for NPP?:

    Do people share scripts here on the forum?

    We often share scripts that are in answer to queries in the forum. But if you have a cool script for PythonScript, feel free to share the code here, and how to use it.



  • @vanowm

    I imagine your script is similar to THIS one of mine, but with some sort of date/time stamp added to the filename?

    BTW, your avatar is about the most exotic I’ve ever seen.



  • @Alan-Kilborn Yes, it’s similar, the main difference besides the date/time added to the filename is that the file backed up BEFORE it’s being saved not after, therefore original code is preserved.
    I’ve posted it here but might as well added to that topic.

    P.S.
    my avatar is an indicator of sense of humor, a lot of people hate it and a lot find it hilarious.



  • @vanowm said in Is there a place to post useful Python scripts for NPP?:

    the file backed up BEFORE it’s being saved not after, therefore original code is preserved.

    It seems to me that if the backup action is done upon every single save, it doesn’t matter.
    But I like it “after” because then the timestamp applied to it is representative of the time the data in the saved snapshot backup was actually changed – the original data is potentially much older than the data I’m about to save (and would have its own snapshot (the previous one) that has a timestamp appropriate to its era.

    I do have something like this running for myself, although I’ve never published it. I created it when the NUL NUL NUL problem was “rampant” and even hit me once. I had N++'s verbose backups turned on, but even the files created with that were corrupted. So I decided at that time to create my own backup method, semi-independent of N++ as to be immune from the NUL problem.



  • @Alan-Kilborn said in Is there a place to post useful Python scripts for NPP?:

    It seems to me that if the backup action is done upon every single save, it doesn’t matter.

    It does, if you want preserve the very original code upon first save.

    But I like it “after” because then the timestamp applied to it is representative of the time the data in the saved snapshot backup was actually changed – the original data is potentially much older than the data I’m about to save (and would have its own snapshot (the previous one) that has a timestamp appropriate to its era.

    The most recent data will be at the original file location, not at the backup, but I see why someone might want have 2 identical files be at different locations.


Log in to reply