• Hello there @mikael !

    I see what your saying but what you cannot see is originally (and before i fixed the duplicate streams) i had somthing similar to this:

    img = Image.open('my_image.png') img.load() img_rs = img.resize((256, 256), 1) with io.BytesIO() as iodata: img_rs.save(iodata, 'png') texture=scene.Texture(ui.Image.from_data(iodata.getvalue(), ... ...

    i changed it to img=img... to reduce code knowing ill never need that exact ref to original again during this loop session.reason is i place the Texture object in a cache dict and from here on is called from there 🤓🤓

    ##EDIT

    @mikael
    I also forgot to include my finally block that handles any mishaps once caching is complete..

    finally: iodata.close() f.close() img.close() del img del f del iodata for x in locals(): print(x)
  • @procryon, my example is same as @JonB , except I just split it up so you see the root dir for Pythonista etc. Functionally the same. Just more step by step

    import os _root_path = os.path.expanduser('~/Documents') _my_dir = 'Brain' _my_file_name = 'yourfile.txt' my_path = os.path.join(_root_path, _my_dir, _my_file_name) print(my_path) with open(my_path, "w") as f: f.writelines("Hello World")
Internal error.

Oops! Looks like something went wrong!