After getting deeper into JavaScript I always miss pythons classes and modules. ((I say JS does not really have classes more beaten up objects … maybe I am to stupid to see them))
I did a lot of scripting in Pythonista and started using Pyto.
As I see it, pyto is definitive the only candidate to use xcallbacks ((I lost 3 days during my holidays to setup the workaround for Pythonista via Objective C mapping last year…))
Are there any experiences with Pyto or with Pythonista especially in combining it with Drafts?
Drafts allows you to run Shortcuts, and Shortcuts can run Pyto scripts. Beyond that, I have no insight into using Python with Drafts.
I will say this: the current version of Pyto has a fatal bug in its editor. Today I was editing three separate files, comparing the three approaches to the same problem. At some point, I noticed that after editing File A, Files B and C contained the same source code as File A. Then I edited File B, and the contents of Files A and C changed. This terrible behavior stopped when I rebooted my iPad, but I don’t consider Pyto safe to use anymore. I sent a bug report and hope to hear back from the developer soon.
On the other hand, I believe the Pyto Run Code action in Shortcuts is still safe, as the source code is kept in Shortcuts, not Pyto.
Update I said above that the overwriting stopped when I rebooted, but a little more testing showed that the correct behavior was only temporary. It started overwriting again.
I started playing with Pyto.
No issues until now. note that I edited the scripts mainly in Drafts (with the upcoming syntax highlighting setupt, that might not be a bad idea).
I started a testing action group if anyone is interested.
To run the list.py in Pyto you have to create it via action first.
I find a split screen Pyto and Drafts a nice experiance for this actions.
The files that overwrote each other were in the same folder. Their first 10 or 11 characters were the same but then had 4-5 characters that distinguished them. Given that we are not running DOS, this shouldn’t be a problem.
I would think md2pptx would fail in iOS as python-pptx has issues there. I would love to be wrong! mdpre should run as it has no python-pptx dependency.
As well as trans cousin mdpre does:
CSV to Markdown tables (with formatting extensions for md2pptx).
Variables
And a few other things I forget (as the author) right now.
I see some issues with md2pptx in my version (HTMLparser has to be renamed to html.parser)
But my investigation got side tracked by Pyto lack of documentation. After my investigation that resolved in the published action group we should be able to test further.
I still have to chase down a bug that @drdrang reported for sleeping well at night- file content should not be mixed up for a proper usage.
Pyto is far ahead of Pythonista in the field of xcallback, pip integration and the fact that is Python3 only.
If this it runs the way I fear, I would have to build my own version after purchasing a new mac…
html.parser got done - and I thought I’d pushed it. Are you saying md2pptx works in Pyto? (I have it installed and would probably use it extensively if it did.)
Please open an issue for what you want. I was doing mdpre and md2pptx in stream mode - and that’s how I’ve set up my make files. But no reason why we couldn’t do something with arguments.
My syntax today is something like:
md2pptx test.pptx < test.md
But it could be something else if that’s all it takes to make it run with Pyto.