• as an aside, it seems that Setting the restype manually to a struct type does not force the objc_msgSend_stret invokation on 32 bit. for instance asset.duration() didnt work, even manually setting rstype, i had to resort to calling msgSend_stret myself.

    Thanks, I'll look into that. Btw, I've made some progress with the type encoding parser, and it should be able to handle most structs automatically in the next build, so you don't necessarily have to create Structure subclasses for things like CMTime.

  • This is simply a ui view that contains a bunch of buttons arranged horizontally. The action of those buttons is to replace the range currently selected in the textview with the text of the key. There are also some special buttons which take other actions.

    Take a look at the stash.py source code, it is pretty clean. Search for vk_tapped, and you can see how the button is initially created, and then what it does in the action.

  • Runpy is not really needed. You could just import webbrowser.py (might be best to rename it to avoid conflicts, then make the stuff at the bottom only happen if __name__=='__main__', then just copy those 3 lines into your own script to launch the view.

    Alternatively, if you don't need the actual Sebastian webbrowser features,just use the built in webbrowser module, webbrowser.open.

  • Not in the current 1.5 version of Pythonista, there would be no way to communicate with them. (As far as I know Arduinos don't have wi-fi support.) In the upcoming 1.6 release it might be possible to use the cb module to communicate via Bluetooth LE, if Arduinos support that.

    (There's also no way to program an Arduino directly and only using Pythonista. They might support Python, but you'd still need a real computer to write the Arduino side of things.)

  • Ooohhhh cool this works

  • Dgelessus,
    My bad... that should be os.path.basename instead. I wasn't sure how windows machines would handle forward slashes in urls, but a quick test shows it works properly.

  • Ahh... Blur out the shielded components? Neat idea.

    You can capture a screenie of a view, which is what draw_snapshot does. Just replace v with whatever component you want to grab. rather than show(), you'll want to use the pil2ui function to get a ui compatible image, which you could set to an imageview's image.

    Also, you might experiment with ImageFilter.GaussianBlur, which looks nicer than BLUR to me. It seems to ignore the radius input parameter. Might be too slow for shield if you are blurring large images.

  • Ok thanks! This is really helpful!

  • That's really cool! I'm trying to make a flight simulator, and that's why I was asking ... Any suggestions? In trying to make the Abe react to the tilting of the devise

  • One other comment, export doesn't seem to ever get called. If you are trying to have export as a button action, it must have exactly one free input variable.

    e.g

    def export(sender): ...

    for a non-instance method, or

    def export(self, sender): ...

    if this is inside a class.

    Using just def export(), the button's action will try to call export(sender), which will generate a TypeError, which the ui code will silently suppress. I've made this mistake more than once, and it is confusing because no warning message is printed!

  • Ok

  • Not currently, I will try this when the update comes out

  • Use the Pythonista file picker to view the image files: Screenshot_[timestamp].png. Three are created for every click the button so you probably have a pile of them by now. I updated the gist code to print out the filenames as they are created.

  • Cool! Thanks for the response

  • Alrighty

  • This does send my text. But does not work with links. Like I can't do this

Internal error.

Oops! Looks like something went wrong!