🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Editing Python Code not persistent

    Scheduled Pinned Locked Moved UIFlow
    5 Posts 4 Posters 11.3k Views 1 Watching
    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.
    • H Offline
      hkubota
      last edited by

      Found this thread from 3 months ago. Re: python back to blocks not working

      The problem (for me) is that I see why Blocky is nice: no syntax errors, and it's usable to teach simple programming. Also I like the general UIFlow interface. Very approachable.

      Looking at the Python code is neat. However if you edit it and you click back to the Blocky code, all your Python changes are gone. Saving your code saves the Blocky code only.
      You can send the Python code to the M5Stack unit though and it's correctly executed.

      Basically the Python code is unsavable and very easy to wipe out by looking at the Blocky page.

      This is not expected behavior and it leads to a confused user.

      Possible fixes in order I'd prefer:

      • Adjust Blocky code according to Python code. Haha! Joking. For simple stuff this might be ok, but have fun converting classes and lambdas into Blocky...
      • Remove the Blocky button or disable it once the Python code is modified. Saving then saves the Python code (not the Blocky one)
      • Warn me about "Your changes in Python will be wiped out. Do you want to proceed?" when clicking on the Block button.

      Doable?

      f3rn4nd0dF 1 Reply Last reply Reply Quote 0
      • f3rn4nd0dF Offline
        f3rn4nd0d @hkubota
        last edited by

        @hkubota What I'd prefer is to keep track of the changes in the code and that they appear in a different color. A text file with the changes to be applied can be saved together with the blocks code. Then you have a button to either apply the changes, so they appear in the python code in a different color and numbered so you can verify that all of them are in place, or you can choose to remove them to see the blocks code translated to Python for debugging purposes. Does it make sense?

        Best regards / Fernando

        1 Reply Last reply Reply Quote 0
        • H Offline
          heybin
          last edited by

          Sounds great, we will try to improve this feature

          1 Reply Last reply Reply Quote 0
          • ajb2k3A Offline
            ajb2k3
            last edited by ajb2k3

            @f3rn4nd0d @hkubota
            I'm not sure if you know this but you can log into the M5stack via USB and directly write micropython code using the REPL functions.

            UIFlow, so easy an adult can learn it!
            If I don't know it, be patient!
            I've ether not learned it or am too drunk to remember it!
            Author of the WIP UIFlow Handbook!
            M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

            f3rn4nd0dF 1 Reply Last reply Reply Quote 0
            • f3rn4nd0dF Offline
              f3rn4nd0d @ajb2k3
              last edited by

              @ajb2k3 Yes, I knew about it. But I think that @hkubota was after is a little different. Maybe to have a way to start designing the ui of the app in UIFlow and then add specific functions in python editor. At least this is what I'm doing. So it would be good to be able to save the blocks and the code separately, and then you can either apply the changes (like a file diff) or not.

              Thanks for your help @ajb2k3!

              1 Reply Last reply Reply Quote 1

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • First post
                Last post