Passing a memory file to function that requires a filename

914 Views Asked by At

I am using pythonista on iOS, although I hope that does not matter. Some lib calls require a path to a json file to render the content into a form/user interface. However as far as I can see, no API to render the JSON data from a variable . I can read in the JSON data and write it out again as a file and use that file, all works correctly. However, I would like to have some type of virtual filename that points to a file object in memory that I can pass to the function. Basically so the function being called is oblivious to the fact that the path i have provided is a memory file handle. I have searched here, it seems this subject is not delt with well. Or I have searched incorrectly. I could imagine, this functionality very sort after.

0

There are 0 best solutions below