• @ihf if you want something new, don't hesitate.

    Next week, I will continue converting outline.py from TableView to scrollView

  • @jaalburquerque as adviced by @JonB , you can use ObjectiveC text attributes

    import random from objc_util import * . . . lt.text = title # set color attributes attrtext = ObjCClass('NSMutableAttributedString').alloc().initWithString_(title) for i in range(len(title)): color = ObjCClass('UIColor').colorWithRed_green_blue_alpha_(random.random(), random.random(), random.random(), 1.0) attrtext.addAttribute_value_range_('NSColor',color,NSRange(i, 1)) ObjCInstance(lt).setAttributedText_(attrtext)

  • Why would they not support it anymore? It's helpful, unless they can provide a substitute for it

  • That works perfectly! Thank you. As always, I really appreciate your help.

  • @Bozmo try to end your script with

    os.abort()
  • Another approach would be to have two views that are the same size, that both use draw() -- but only call set_needs_display on the view that needs update. So, it you have 4 graphs, each controlled by different sliders, you'd only need to update the changed views.

    The thing you have to be careful with using an image view is whether you redraw the image when the view gets resized (say, when orientation changes). You can use a layout method to handle size changes, and regenerate the image if needed. Multiple views with different draw methods would get draw called automatically upon resize.

  • Hi Jon,

    Thanks for your detailed reply — sounds like it's a little complex for what I want to do.

    Am using the library with some drawing code and was hoping I could use my iPad as a mobile coding station — but... guess not now.

    Thanks anyway!

    James

  • Latest addition:

    https://github.com/Bambla78/Pythonista_SunCalculator_for_iPhone/blob/main/suncompass.py

    Roll and pitch values of your iPhone for optimal horizontal positioning of your compass.

    The values in the upper right corner must be both < 0.009xx in order to show the same heading as the official Apple iPhone compass app, given there are no other disturbing influences on the magnetometer.

    As I already said above, the official iPhone compass app is more robust and you don’t need to treat it like a raw egg to ensure precision, but I don’t know what Apple does to achieve this.

  • I believe that the today widget requires a UI. You can have a simple view with just a ui.Label or TextView to contain your printout.

  • @jkoen Your shortcut can run a PyThonista script and pass an argument via url scheme

    Url = pythonista://MyScript?action=run&args=argument
    Open url

    Your script can recall your shortcut via url scheme

    webbrowser.open("shortcuts://run-shortcut?name=[name]&input=[input]&text=[text]")

    See https://support.apple.com/en-en/guide/shortcuts/apd624386f42/ios

  • @ccc yes but also True if duplicate of '0' and he asks for only S and F...

  • No need to respond, I figured out the problem.

  • @ccc said

    def ui2pil(ui_img):
    with io.BytesIO(ui_img.to_png()) as mem_file:
    return PILImage.open(mem_file.getvalue())

    Not sure that your code works, doesn't PILImage.open need a path?

    I know the reverse pil2ui

    def pil2ui(imgIn): with io.BytesIO() as bIO: imgIn.save(bIO, 'PNG') imgOut = ui.Image.from_data(bIO.getvalue()) return imgOut
  • @JonB I got an RDP so I can use actual Python. But I have one problem, when I try to run a script I have it immediately closes.

  • I was asking for the text that is under the box with the two arrows in the upper right corner of the window.

    You can run @JonB's code in the Python REPL. We suspect that it will show you the path to a file in the local directory called attr.py and its presence is preventing Python from finding a second file with the same name in the package. If this is the case, then rename the local file and try again.

  • @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.

  • Thanks for the replies and suggestions!

    I tried using the approach of creating SpriteNode obs for each vertical slice in the graph and setting their texture to None along with the color as desired. Then, in the update, I just loop through them and set their size to (1, desired_height) and position to the proper place.

    On initial testing I noticed artifacts, gaps occasionally between the obs on screen. I bumped the size up to (1.1, desired_height) and that fixed it. Probably rounding errors, etc. causing some gaps. With this in place, it seems to be working and pythonista doesn't crash after awhile since I'm not continually creating new path obs with every update.

    The shader approach sounds interesting, seeing that now, but haven't tried it. Will keep that in mind for the future though, maybe worth experimenting with.

  • Thanks a lot, this seems to help a lot. 👍

  • You would need to change the dict, (dunno what your data source looks like), then call
    self.rebuild_flat_entries() followed by self.table_view.reload() on the controller .

    Alternatively, whatever is updating the dict in the first place would call table_view.insert_rows, similar to how do_expand works.

  • If you are bored with Apple music then you can switch to spotify where there are all the songs you need to find if you want to use more free spotify premium you can refer here https://modsuper. com/tr/spotify-premium

Internal error.

Oops! Looks like something went wrong!