1

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.

IanJ
  • 21
  • 2
  • Umm... most functions that are properly written will take a filename or a "file like object" and *just work*... do you have access to modify the function itself? Otherwise you'll have to wrap the function to create a temporary file, use that, and let it get deleted on close... – Jon Clements Jun 02 '15 at 11:31
  • Yeah, I get your point. I am very new to python. But we are talking about some libraries specifically written for iOS. Is work in progress I think, however still exceptional work this guy has done and continues to do. If you have a iOS device, you should look at this app (Pythonista), if not never mind. But I am still sure there are times this functionality is required with 3rd party Libs. Any ideas appreciated – IanJ Jun 02 '15 at 11:40
  • Could you show some code so I can have a play with some ideas? – cdarke Jun 02 '15 at 12:19

0 Answers0