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.


    Find text in console

    Pythonista
    4
    46
    16757
    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.
    • mikael
      mikael @cvp last edited by

      @cvp, @Matteo, very useful, this should be a standard feature of Pythonista.

      Matteo 1 Reply Last reply Reply Quote 0
      • pavlinb
        pavlinb last edited by

        Just brilliant.

        1 Reply Last reply Reply Quote 0
        • Matteo
          Matteo @cvp last edited by

          @cvp Hi, I haven't tried it yet your code but it is impressive! Thank you :-)

          I sometimes feel that there is a possibility to do something with programming, but every time I see that one of you programmers really manages to do it, I am fascinated.

          I want to try your code by saving it in the StatusBarMenu (by JonB) as an action to run with the little buttons of it. So my dream is to associate your script to a user key of StatusBarMenu in order to enable/disable the search text function.
          So do you know if it is possible to disable your search function (with a click) if user wants to return to use the console to run python commands instead of to search text?

          Thank you very much
          Regards

          cvp 1 Reply Last reply Reply Quote 0
          • cvp
            cvp @Matteo last edited by cvp

            @Matteo It is not needed. Even if you activate the search, the normal use of the console command still works by pressing enter. The search is only done if you tap the 🔍 icon.

            Matteo 1 Reply Last reply Reply Quote 0
            • Matteo
              Matteo @mikael last edited by

              @mikael Hi, I still use Pythonista version 3.1 (I have an old iphone with ios 10.3.3) and it is a great software, I find it very exciting to think that user can even customize the interface of this application as you wish, if knows how to do it ;-)

              Pythonista is Great!

              cvp 1 Reply Last reply Reply Quote 0
              • cvp
                cvp @Matteo last edited by

                @Matteo said:

                Pythonista is Great!

                Full agree. I hope you have seen my previous post because we wrote at the same time

                1 Reply Last reply Reply Quote 0
                • Matteo
                  Matteo @cvp last edited by Matteo

                  @cvp Yes! you are right, sorry, two buttons on console line! You created a second button at left of input line, Thank you again!

                  cvp 1 Reply Last reply Reply Quote 0
                  • cvp
                    cvp @Matteo last edited by

                    @Matteo said:

                    two buttons on console line

                    Do you see two buttons on the console line?

                    Matteo 1 Reply Last reply Reply Quote 0
                    • Matteo
                      Matteo @cvp last edited by

                      @cvp no no, I badly explained myself sorry, I meant I see your button search at left, at right I see the built-in recall command icons and the execute command is the return key of keyboard, yes sorry. I'm excited...

                      cvp 1 Reply Last reply Reply Quote 0
                      • cvp
                        cvp @Matteo last edited by

                        @Matteo 👍

                        Matteo 1 Reply Last reply Reply Quote 0
                        • Matteo
                          Matteo @cvp last edited by

                          Hi @cvp, thanks again for your code, it helps me a lot! I tried to change it in order to clear highlighting of the text before each touch of the "Find" button, because if I search different words, the console becomes too colored and I can't understand where the last word is selected.

                          If you want and have time, can you show me how to change your code in order to remove all highlighting before each touch of your "Find" user key?

                          Thanks
                          Bye

                          cvp 1 Reply Last reply Reply Quote 0
                          • cvp
                            cvp @Matteo last edited by cvp

                            @Matteo that is strange, because when you tap the find button, I remove all colored buttons before to create new ones, thus no overlap of multiple searches.
                            Did you change something?
                            I just retry and there is no problem...

                            Could you post your code if not exactly mine

                            Matteo 1 Reply Last reply Reply Quote 0
                            • Matteo
                              Matteo @cvp last edited by

                              @cvp Hi thanks for reply, with Pythonista I use (v.3.1 301016) on ios 10.3.3 I have different behavior from you , that is when I touch Find key , the previous highligtings can't disappear (text become red and more red...). Maybe it is due to different objc implementation of new version of Pythonista.

                              I will try again , if I will notice some different behavior I will let you know.

                              Thank you
                              Regards

                              cvp 1 Reply Last reply Reply Quote 0
                              • cvp
                                cvp @Matteo last edited by

                                @Matteo ok. I use Pythonista last beta on iOS 13.3.

                                Matteo 1 Reply Last reply Reply Quote 0
                                • Matteo
                                  Matteo @cvp last edited by Matteo

                                  @cvp Hi, sorry I'm feel very unskilled, no objc problem, I must use Python3, no Python2...

                                  Problem solved!

                                  Sorry I ask you :when you touch built-in key Clear in console do you have the clear of full console content and the color red of last highligthed text?

                                  Thanks

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

                                    @Matteo I thought about this problem of python 2 or 3 overnight and I wanted to check this morning because I "remove SUIButton_PY3 objects" ... Great that you found it

                                    1 Reply Last reply Reply Quote 0
                                    • cvp
                                      cvp @Matteo last edited by cvp

                                      @Matteo said:

                                      clear of full console content and the color red of last highligthed text?

                                      You're right, that's a problem. My script does not know when you tap the clear button thus it is not able to also clear the couloured buttons. I'll try to find something but not promised

                                      temporarily, you would have to clear manually the console line then tap the 🔍 button, colorful buttons will be removed

                                      Edit: if you have cleared the console, tap only the 🔍 button, even without clearing the search text, all highlighted words will disappear

                                      Matteo 1 Reply Last reply Reply Quote 1
                                      • Matteo
                                        Matteo @cvp last edited by

                                        @cvp You are right, to clear all I can use your Search button with empty text, perfect.

                                        Many thanks for your help!

                                        Regards

                                        cvp 2 Replies Last reply Reply Quote 0
                                        • cvp
                                          cvp @Matteo last edited by

                                          @Matteo And, if you tap the standard clear button, you can, after, tap the search button even without clearing the searched text. As the console is cleared, there is no occurrence to find, thus all highlighted will be removed

                                          1 Reply Last reply Reply Quote 1
                                          • cvp
                                            cvp @Matteo last edited by

                                            @Matteo small update if you want a case insensitive search

                                            				for m in re.finditer('(?i)'+txt, t): 
                                            
                                            Matteo 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Powered by NodeBB Forums | Contributors