omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    [SHARE CODE] Create a .py file in a dir, from tools menu

    Pythonista
    editor share code tools
    1
    2
    3477
    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.
    • Phuket2
      Phuket2 last edited by Phuket2

      Ok, some more trivial code to share. This is for the tools menu. All it does is create a temp file in a directory , if you want with some text inserted in the file, you can also do. Then it opens up the newly created file in the editor (sorry, it replaces the active tab, I looked, but I don't think I can change that). While its a temp file, it does not get deleted (using NamedTemporaryFile with delete = False). I often want to try new things and need a type of scratch pad. This script basically gives you this functionality. It's important to me, because so often I just create a file in the dir I am in and call it test.py or crap.py etc.. I just screw up my project directory with lots of crap files for testing something.
      I tried to write this with some care to errors.
      Personally, I would love to see a framework you have to write to when publishing scripts for the tools menu. Whilst I can grasp and understand the concepts of these type of frameworks, it's beyond me to write one.
      But I think the tools menu is trivialised because of this. Again, I could be wrong as I often am 😁

      But the gist is at
      Gist

      1 Reply Last reply Reply Quote 0
      • Phuket2
        Phuket2 last edited by Phuket2

        I know I am going to hate myself in the morning, but I will try repo's again. I am using working copy now also. The hardest thing with the repo's for me is to understand the pulls requests etc... And keep on top of it...
        But the repo is
        repo

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Powered by NodeBB Forums | Contributors