Programming experience since the late 1990s: PLC programming and C++ for profession, a lot of Python for tools for daily work and - most important - for fun ;-)
-
-
skrohmer
Hi friends of electronic music :-),
I'm looking for a possibility to use Pythonista for communicating to MIDI devices. I have found one thread here (created about 2 years ago) discussing this a bit, but there is no solution mentioned. What's the current situation? Do I e.g. have a possibility to use objc_util to call the required functions? Did anyone already play around with this? Thanks!
Stefan
-
skrohmer
OK, things can be so easy ;-). I tried it with a PNG, and the example works only for JPEGs.
-
skrohmer
Hello,
I have recently upgraded to a new iPad Air and also installed the new Pythonista version. Now the extension does not find images anymore. You can test this with the example "Copy Photo Location". When I send an image to this extension I get the position information of the image if I use the iPhone. When I do this on the iPad I get the message "No input image found". Either it is related to iPhone / iPad or to iOS 10.0.2 / 10.2. The iPad runs iOS 10.2. I think this is the problem. My last iPad with iOS 10.0.2 worked fine. Can anyone reproduce this behavior?
Stefan
-
skrohmer
Thanks, I will try this. I was so focused on the word 'destructor' that I missed them.
-
skrohmer
Hello Pythonista friends,
Me again ;-) with a simple question which could not be answered by the documentation: Is there any kind of useable destructor for a Scene object? When terminating the program I would like to save some data which is created dynamically during the runtime and as I see for the moment the nicest solution would be a member function within my class (the class is derived from scene.Scene). Sometimes I have used
__del__
in other classes but it does not seem to work in a stable way. Is there a function within Scene which is called when the scene is closed and all nodes are still available?Stefan
-
skrohmer
Yes, see above:
print 'hello'
;-) You don't really need code, one line printing some text (or sys.argv) is enough. Go to Settings / Share Extension Shortcuts -> create a new shortcut -> set Arguments to any value. After that run the extension by sharing any file. That's it. -
skrohmer
Hi,
Does anyone have an sharing extension running successfully which receives arguments at the call? I don't even get the simplest program running which only contains
print 'hello'
. When I leave the shortcut parameter "Arguments" blank the program runs. When I set the arguments to any string or number the program is not called.Stefan
-
skrohmer
This seems to be the shortest solution for now:
import ui from scene import * class MyScene(Scene): def setup(self): pass def get_viewpos_from_touch(self, touch): xt, yt = touch.location xw, yw = ui.get_window_size() return xt, yw - yt def touch_began(self, touch): menu = ui.View(frame=(0, 0, 200, 200)) menu.present('popover', popover_location=self.get_viewpos_from_touch(touch)) run(MyScene())
I can live with that at least at the moment. I hope that "hiding" the popup as I already explained does not result in memory leaks. ;-)
However, I'm still interested in any information which explains the strange behavior mentioned above: Why does the popup not close completely?
-
skrohmer
Yes, seems to be better. I will check again which is the best solution for me. I'm still struggling with this popup. Maybe someone else has a hint, too. Maybe @omz can tell us why the popup does not disappear completely when I click beside it.
BTW: The position seems to be strange because the coordinate systems are different. The popup placed at position 0,0 appears in the top left corner, but the point 0,0 of the touch coordinates is in the bottom left corner. The Y axes are leading in different directions.