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.


    Flick button keyboard.

    Pythonista
    5
    491
    7908
    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.
    • cvp
      cvp @shinya.ta last edited by

      @shinya.ta On iPad or iPhone, swipe right to left and console appears.
      At the bottom, you can type Python line

      shinya.ta 1 Reply Last reply Reply Quote 0
      • shinya.ta
        shinya.ta @cvp last edited by

        @cvp

        I see ">>> import gesTraceback (most recent call last) : File" <string> ", line one, in <module> ModuleNotFoundError : No module named' ges'".

        cvp 1 Reply Last reply Reply Quote 0
        • cvp
          cvp @shinya.ta last edited by

          @shinya.ta ok, that will say that you have pressed the enter key. But without pressing the enter key, do you see

          If yes, that will say that the copy of gestures.py from GitHub has been successful

          shinya.ta 2 Replies Last reply Reply Quote 0
          • shinya.ta
            shinya.ta @cvp last edited by

            @cvp
            It will say ">>> import gestures".

            1 Reply Last reply Reply Quote 0
            • shinya.ta
              shinya.ta @cvp last edited by

              @cvp said:

              @shinya.ta ok, that will say that you have pressed the enter key. But without pressing the enter key, do you see

              If yes, that will say that the copy of gestures.py from GitHub has been successful

              It doesn't look like this.

              cvp 1 Reply Last reply Reply Quote 0
              • cvp
                cvp @shinya.ta last edited by cvp

                @shinya.ta please, copy this script and paste in a new empty script, then run it

                import os
                import requests
                url = 'https://raw.githubusercontent.com/mikaelho/pythonista-gestures/master/gestures.py'
                data = requests.get(url).content
                dir  = os.path.expanduser('~/Documents/site-packages')  
                file_name = url.split('/')[-1]
                path = dir + '/' + file_name
                with open(path,mode='wb') as out_file:
                    out_file.write(data)
                

                Then retry to type "import ges" in console

                shinya.ta 1 Reply Last reply Reply Quote 0
                • shinya.ta
                  shinya.ta @cvp last edited by

                  @cvp
                  I entered "import ges" but the reaction is the same as before.

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

                    Try writing this as a text file (not bytes) to the local directory instead of site-packages

                    import os
                    import requests
                    url = 'https://raw.githubusercontent.com/mikaelho/pythonista-gestures/master/gestures.py'
                    data = requests.get(url).text
                    dir  = os.path.expanduser('~/Documents/')  
                    file_name = url.split('/')[-1]
                    path = dir + '/' + file_name
                    with open(path,mode='w') as out_file:
                        out_file.write(data)
                    
                    shinya.ta 1 Reply Last reply Reply Quote 0
                    • shinya.ta
                      shinya.ta @ccc last edited by

                      @ccc said:

                      Try writing this as a text file (not bytes) to the local directory instead of site-packages

                      import os
                      import requests
                      url = 'https://raw.githubusercontent.com/mikaelho/pythonista-gestures/master/gestures.py'
                      data = requests.get(url).text
                      dir  = os.path.expanduser('~/Documents/')  
                      file_name = url.split('/')[-1]
                      path = dir + '/' + file_name
                      with open(path,mode='w') as out_file:
                          out_file.write(data)
                      

                      I tried it.
                      The last line will say "UnicodeEncodeError".

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

                        data = requests.get(url).text # <-- text, not context?

                        with open(path,mode='w') as out_file: # 'w' not 'wb' ?

                        shinya.ta 1 Reply Last reply Reply Quote 0
                        • shinya.ta
                          shinya.ta @ccc last edited by

                          @ccc

                          "out_file.write(data)"

                          There is an error here.

                          cvp 2 Replies Last reply Reply Quote 0
                          • cvp
                            cvp @shinya.ta last edited by

                            @shinya.ta @ccc believe me, I use my script very often and it works successfully each time, no reason to change it.

                            1 Reply Last reply Reply Quote 0
                            • cvp
                              cvp @shinya.ta last edited by cvp

                              @shinya.ta last try in another way.

                              Go to https://raw.githubusercontent.com/mikaelho/pythonista-gestures/master/gestures.py,
                              Long press on text, then “select all”, then “copy”
                              Then, in Pythonista, create an empty script named gestures.py (no uppercase) in the folder where your “Emojis keyboard,py” is, and paste the copied code

                              shinya.ta 3 Replies Last reply Reply Quote 0
                              • Danielpitts
                                Danielpitts last edited by

                                This post is deleted!
                                1 Reply Last reply Reply Quote 0
                                • shinya.ta
                                  shinya.ta @cvp last edited by

                                  @cvp
                                  I copied and pasted it to a new folder.
                                  Nothing special will happen.

                                  cvp 2 Replies Last reply Reply Quote 0
                                  • shinya.ta
                                    shinya.ta @cvp last edited by

                                    @cvp
                                    Currently, "Emoji keyboard, py" works on iPhone but not on iPad.
                                    Is it because of the OS version?
                                    I've done all the tests on my iPhone.

                                    1 Reply Last reply Reply Quote 0
                                    • shinya.ta
                                      shinya.ta @cvp last edited by

                                      @cvp

                                      Isn't it good to put "gestures. py" directly into "Emoji keyboard, py"?

                                      cvp 1 Reply Last reply Reply Quote 0
                                      • cvp
                                        cvp @shinya.ta last edited by

                                        @shinya.ta said

                                        I copied and pasted it to a new folder

                                        Why a new folder? This gestures.py has to be in the folder of your Emojis keyboard.py or in the site-packages folder, why do you want a new folder? Please, we have already so much difficulty to find a solution, when we propose something, please do it or we will never solve your problem

                                        shinya.ta 1 Reply Last reply Reply Quote 0
                                        • cvp
                                          cvp @shinya.ta last edited by

                                          @shinya.ta Sid

                                          Isn't it good to put "gestures. py" directly into "Emoji keyboard, py"?

                                          No, please. In this case, every time I will modify Emojis keyboard.py, you will have to insert gestures module. That's the reason why Python has the "import" statement

                                          1 Reply Last reply Reply Quote 0
                                          • cvp
                                            cvp @shinya.ta last edited by

                                            @shinya.ta si

                                            Nothing special will happen.

                                            Nothing has to happen. But the new Emojis keyboard.py will only run ok if you have a gestures module able to be imported.

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