• Pretty sure that is all either depreciated, or only works on jailbroken devices. I tried the very first line, IOHIDEventSystemCreate, and it returned a null pointer.

  • @omz This code is very helpful for me. From the apple developer website (https://developer.apple.com/documentation/avfoundation/avcapturestillimageoutput), the AVCaptureStillImageOutput class is going to be instead with AVCapturePhotoOutput class. Could you give a similar example with the new AVCapturePhotoOutput class? Thank you very much!

  • Got it. There is setter code in the library and I was overriding it. Here is the fixed code:

    from scene import Scene, SpriteNode, run, EffectNode class pt(SpriteNode): def __init__(self, **kargs): SpriteNode.__init__(self, 'plf:HudX', **kargs) self.scale = 0.5 class plot (SpriteNode): def __init__(self, **kargs): SpriteNode.__init__(self, **kargs) self.anchor_point = (0, 0) self.color = '#8989ff' class test(Scene): def setup(self): clip = EffectNode(parent=self) clip.crop_rect = (0, 0, self.size.x / 2, self.size.y / 2) pane = plot(parent=clip) pane.size = (self.size.x / 2, self.size.y / 2) clip.position = (50, 50) for x in (50, 100, 150, 200, 250, 300, 350, 400): p = pt(parent=pane) p.position = (x, x) if __name__ == '__main__': tst = test() run(tst) ```
  • Its an interesting thought. Mostly because Ole mentioned he positions pythonista value as not just running scripts, but creating games and UI. From that perspective, would be good to be able to run the UI/games on OS X.

    From a pure running scripts perspective, I agree - we shouldnt need a new python environmnent since it doesnt align with cross platform compatability. I make most of scripts pythonista and regular linux env compatable by checking if imports exist.

    That said, i do understand. Even while we have aws s3 sync cli on mac, i wrote https://github.com/khilnani/s3sync.py for pythonista that works on desktop in the same way to share files between ios and desktop

    In short, because of the UI apps you can build with Pythonista, would be nice to ruin the same UI apps on OX X

  • @jonb and @ccc Thank you for the suggested improvements. The original code was not mine and for whatever reason the author decided on urllib rather than requests. Ystockquote stopped providing historical quotes so this code is meant to fill in that deficiency.

    @JonB Thank you!! for taking the time to provide a working script. It is now installed as part of an IOS widget.

  • @Phuket2 I tested with Python 3. I think Python 2 is still faster in most benchmarks.

  • @enceladus , thanks for taking the time to explain. The defaults look at lot better the way you have done them (I think I seen the way I used in stackflow one time and have used that way, goes to show you should look at multiple sources). I understand your dict attr del, I just question @omz reasoning behind this approach. Not to be a smart ass. Just to learn. I do all sort of weird things at times (well all the time). It just really points out to me how important it is to think about inferences/rules made with Params. Look, maybe what @omz has done is actually very Pythonetic, I am certainly in no position to correct him.
    Anyway, thanks again. I am just playing with this wrapper around dialogs.form_dialog. I am going to try to add some persistence to it using shelve I think. Sure I will run into more troubles, so I will be back :)

  • Is your device jailbroken? Some jailbreak "hiding" tools can cause this issue with Pythonista. If you have one, try disabling it and see if that helps - Pythonista works fine on jailbroken devices in general. (Note: I don't have a jailbreak myself, I'm basically repeating what other people have said in the past.)

  • Thanks. That is working for me.

  • It was something stupid. Spelled the reference to the file Handel wrong.


  • Thanks, ole! I'll give it a go!

  • Hi,

    here's the example how to use UITableViewRowAction for this purpose.

    #!python3 import ui from objc_util import * # # UITableViewDelegate # def handler(_cmd, action, index_path): print('Trash it!') block_handler = ObjCBlock(handler, restype=None, argtypes=[c_void_p, c_void_p, c_void_p]) def tableView_editActionsForRowAtIndexPath_(self, cmd, table_view, index_path): yellow = ObjCClass('UIColor').yellowColor() action = ObjCClass('UITableViewRowAction').rowActionWithStyle_title_handler_(0, ns('Trash it!'), block_handler) action.setBackgroundColor(yellow) return ns([action]).ptr def make_table_view_delegate(): methods = [tableView_editActionsForRowAtIndexPath_] protocols = ['UITableViewDelegate'] delegate = create_objc_class('CustomTableViewDelegate', methods=methods, protocols=protocols) return delegate.alloc().init() # # UITableView # table_view = ui.TableView(name='Custom Action', frame=(0, 0, 300, 480)) table_view.data_source = ui.ListDataSource(['Hallo', 'Hi', 'Ciao']) table_view_objc = ObjCInstance(table_view) table_view_objc.setDelegate(make_table_view_delegate()) table_view.present('sheet')
  • Ahhh, thanks! Both comments helped, thx guys, works perfectly now.

  • 69 :) Smaller iPad or iPhone could provide better score IMHO :)

  • @m_doyle04 , no problems. I am sure you will be teaching me before too long.

  • Very glad I could be of any help to you..

    But, you know, I think both of us should above all thank omz for this very remarkable software…

    Thanks again for your answer

  • @JonB


Internal error.

Oops! Looks like something went wrong!