• @dgelessus As with only two lines, get_services() and get_keychain(), you can get the data of keychain memory, I never shall store there sensitive data, without a real password protection. I only wanted to store my parameters without using a file that the user could remove by accident.
    About Python dictionary, I recognize I don't know a lot about it.Thanks for the info.

  • The question is a little different, since he already has written to the console, and NOW wants to save it. Technically this can be done in 3 lines, so qualifies for ccc's ten lines or less....
    though i broke up the long string of method calls onto multiple lines to keep some semblance of readability.

    This is my save_session script which appends to a command history file ( making it easier to convert an interactive session into a real script), and writes the current console output to a new file. Feel free to adapt to your own needs.

    from objc_util import UIApplication from time import ctime # save history with open('history.py','a') as f: f.write(ctime()+'\n') f.write( '\n'.join([str(h) for h in UIApplication.sharedApplication().keyWindow(). rootViewController().accessoryViewController(). consoleViewController().history() ])+'\n') #save console output with open('console_history.txt','w') as f: f.write(ctime()+'\n') f.write(str( UIApplication.sharedApplication(). keyWindow().rootViewController(). accessoryViewController().consoleViewController(). consoleOutputTextView().text() ))
  • https://gist.github.com/389a67c5aacb097b87fd

    Simply import this function, and run it after drawing to the canvas. see example.
    It is not necessary to fill the canvas white- it is actually transparent, unless you have drawn to it (as should be obvious when you save an image then quickview it)

Internal error.

Oops! Looks like something went wrong!