• invalid base64 encode.
    remove 'data:image/png;base64,' like this:

    data_uri = base64.b64encode(buffer.getvalue()).decode('ascii')

    now it works


  • @MartinPacker I have been working on a script that does something similar with a UI where you have functions and data is passed from one to the other, I had to keep track of input and output types to make sure the function the data is passed to can handle it. Anyway if you would like to take a look it is available here this might be totally overkill to what you want but you can have a look how I pass data etc

  • https://docs.python.org/2/library/os.html#os.curdir

    os.curdir == '.'
    os.pardir == '..'

  • On idea 2 it seems Multimarkdown 4.4.2 allows you to include metadata items in text...

    fred: jim

    Here is [%fred].

    The symbol above should resolve nicely. It doesn't in Editorial and it doesn't in Byword. I wonder what level of Multimarkdown processor Editorial is using.

  • Solved - using BaseHTTPServer and handling do_GET to add the Content-Type header and then serve the file contents.

    (This helped a lot.)

    So now Pythonista can serve Offline Web Apps. Which means it can go down and still Safari bookmark in Slide Over can access the "widget".

    Might couple that with a Workflow flow that invokes URLs from a palette and publish a follow up web post.

  • Ah - over to the right. Never noticed it. Thanks!

  • Instead of trying to find out what your environment is, go through all known methods of getting the current file and use the first one that works.

    try: import editor filename = editor.get_current_file() except (ImportError, AttributeError): try: # Not Pythonista or Editorial import whatever_sublime_text_uses filename = whatever_sublime_text_uses.what_is_my_filename() except (ImportError, AttributeError): print("Could not determine currently open file!")
  • And note xml module claims a subset of xpath support.

  • This feature was never available in the iPhone version, it's iPad only.

  • OK. Thanks for the swift reply.

    You might in a future release want to highlight embedded HTML. Or at least comments. I think the former is easier to do than actually parsing it to find just comments. One colour for the lot.

  • This works in Pythonista but probably needs modification to work in Editorial.


  • Yes, there are posted workflows to convert html to other formats, like PDF. Search the workflows website for the format you want to convert to. I don't remember ODP.

  • I don't see a way of posting a new thread, so I will reply to this very general subject title.

    I would like to know how to enhance this code so that I can drag the rectangles that are in the canvas. Please notice that the background picture is a staff of lines and that the javascript in written within the html /html tags to make make the canvas get drawn on top of the background picture.

    <!DOCTYPE html> <html> <head> <title>rectangles on staff</title> <meta name="description" content="Mathematics From The Beginning" /> <meta name="keywords" content="Formal definitions, undefined terms, sets, ordered sets" /> <meta name="author" content="James Adrian"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style> a.link_style0:link {color: #000000; text-decoration: none;} a.link_style0:visited {color: #000000; text-decoration: none;} a.link_style0:hover {color: #00AA00; text-decoration: none;} a.link_style0:active {color: #000000; text-decoration: none;} a.link_style1:link {color: #000000;} a.link_style1:visited {color: #000000;} a.link_style1:hover {color: #00AA00;} a.link_style1:active {color: #000000;} </style> <body style="background-image: url(https://www.futurebeacon.com/00Music/cstaffx.png);"> <div style="position: absolute; top: 0px; left: 0px;"> <canvas id="myCanvas" width="2300" height="1500" style="border:1px solid #d3d3d3;"> <script type="text/javascript"> var c = document.getElementById("myCanvas"); var ctx = c.getContext("2d"); // Red rectangle ctx.beginPath(); ctx.lineWidth = "6"; ctx.strokeStyle = "#FF0000"; // ( left, top, width, hight) ctx.rect(300, 120, 220, 20); ctx.stroke(); // The above rectangle is located at 300px // from the left edge of the canvas and 120px // from the top of the canvas. // The above rectangle is 220px wide // and 20px high // Red rectangle ctx.beginPath(); ctx.lineWidth = "2"; ctx.strokeStyle = "#008888"; ctx.rect(560, 250, 17, 17); ctx.stroke(); // The above rectangle is 530px by 50px // and is located at 220px from the top of the canvas // and 14px to the right within the canvas // Green rectangle ctx.beginPath(); ctx.lineWidth = "4"; ctx.strokeStyle = "#00FF00"; ctx.rect(300, 300, 50, 50); ctx.stroke(); // Blue rectangle ctx.beginPath(); ctx.lineWidth = "10"; ctx.strokeStyle = "#0000FF"; ctx.rect(500, 500, 150, 80); ctx.stroke(); </script> </div> </body> </html>

    Thank you for your help.

    Jim Adrian

  • I just discovered that there is an Evernote module included. Are you using that already?

  • Well how do I name it? When I try to load it it's not there.

    Thanks for your reply @beer2011

  • Thanks! Will do. I just got "Hello World" - type in some text and push a button and it pops up a message at you. THAT'S a starting point.

  • Works nicely, thanks!

  • This Evernote note of workflows sounds intriguing, sir.

Internal error.

Oops! Looks like something went wrong!