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.
Reverse geo code in a scene script
-
In the below script, the #1 output works as expected. The #2 output, though, called from within the scene object, does not. For #2, the location comes back correctly but the reverse geocode call always returns None. The reverse geocode doesn’t seem to work when called from scene code. Any idea how to get this to work?
from scene import * import location class MyScene (Scene): def setup(self): loc2 = location.get_location() addr2 = location.reverse_geocode(loc2) print('#2') print(loc2) print(addr2) if __name__ == '__main__': loc1 = location.get_location() addr1 = location.reverse_geocode(loc1) print('#1') print(loc1) print(addr1) run(MyScene(), show_fps=False)
-
Having trouble editing the post on mobile, but note there is the below line before getting loc1. Missed that when posting.
location.start_updates()
-
Found the below thread with the solution. Just need to add @ui.in_background above the scene method definition!
-
The #2 Print Statement in the scene only shows a single line of text at the bottom of the scene window in my iPhone.
The console Output shows both #1 and #2.
Is it possible to simply print text into a scene with coordinates so I don’t need a labelnode?
-
When you exit the script and swipe over to the console you’ll see the full output.
-
@nerdtron Thanks, I know the console displays the whole text.
I was just wondering if there is an easy way to place print commands with coordinates into a scene wirhout having to use labelnodes.
The old 8 Bit Basic dialects had this, and for Python being a mental descendant of this programming Culture I wish there was the same easy approach.