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.


    Today Widget: Get print() working

    Pythonista
    6
    13
    9081
    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.
    • georg.viehoever
      georg.viehoever last edited by

      I tried to create a simple today widget for the latest Pythonista Beta that just prints the time. The widget logo shows on the screen, but nothing else happens.

      '''testing today widget
      '''
      import datetime as dt
      print('Python time is %s'%dt.datetime.now())

      What's needed to get this working?
      Georg

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

        Just using print('blah') worked for me. Your simple example also worked. Are you sure you set the right script in Pythonista's settings?

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

          That should work. I found that in some cases (pretty rare), the widget script doesn't run automatically when you pull down Notification Center, and you may have to tap the run button in the widget manually (the triangle is not a logo). I'm not sure why this happens.

          1 Reply Last reply Reply Quote 0
          • georg.viehoever
            georg.viehoever last edited by

            Seems to be working now. I did not see the run button during my previous attempts. Maybe I was too impatient with my slow iPad 2...
            Resolved! Thanks,
            Georg

            1 Reply Last reply Reply Quote 0
            • georg.viehoever
              georg.viehoever last edited by

              After the .10 update this evening, it stopped working again. The widget was at the lower end of my displayed widgets, and did not show the run-triangle nor the script result. It started working after moving the widget to the top of the list.
              I wonder if the widget position contributes to the problem, or if the python interpreter running the widget just needs a lot of time for the first start up.
              Georg

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

                @georg-viehoever How many widgets do you have? I wonder if the iPad 2 maybe just doesn't have enough memory to handle multiple widgets properly, and the Pythonista widget is probably more on the heavy side of things...

                1 Reply Last reply Reply Quote 0
                • georg.viehoever
                  georg.viehoever last edited by

                  Six active widgets...
                  Now that the Pythonista widget has worked once, it seems to work fine every time. Strange.
                  Georg

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

                    This works fine on my iPad Pro but on iPhone6 I don't see the Pythonista Entry. Any hints?

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

                      @wnMark I don't know why that happens. I've seen the widget disappear completely a couple of times. You could try re-selecting the widget script in Pythonista's settings. Rebooting also seems to help.

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

                        For me widgets sometimes disappear completely too. They don't appear in the list of available widgets at all and aren't visible in the notification center. If I'm lucky they reappear again at some point. For some reason last time rotating my screen made them reappear...

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

                          @dgelessus That's the intended behavior. On iPad, you can select if you want to add new widgets to the "Today View" or to the "Widgets View". When you are in Portrait orientation, all widgets appear in the same list, but when you rotate to landscape, only "Today View" widgets are listed in the left column, while all "Widget View" widgets are available via the segmented control on top of the notifications list.

                          1 Reply Last reply Reply Quote 1
                          • dgelessus
                            dgelessus last edited by

                            @lukaskollmer In my case widgets don't appear under Today, Widgets or in the list of available widgets. Or to put it differently - when you tap the "edit" button at the bottom of the Today list, every widget should be somewhere in that list (under one of the three sections). Sometimes some widgets are just missing and under none of the sections.

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

                              No luck for me on iphone6 or iphone5s.

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