This tutorial assumes you've installed CrosKeys by CrosExperts and have an active CrosKeys Pro membership.
PyScripts use the power of Pyodide and WASM to run Python scripts in a Sandboxed page.
1. Initial Setup
Unlike Apps Script, there's not much setup needed to start using PyScripts. Just go to the Scripting Manager (XM) and write or paste your desired PyScript in the PyScripting tab.
2. Parameters & Displaying Results
As seen in the example above, parameters can be assigned by pressing the "Add Parameter" button.
Whatever words you place in the parameter text input will be replaced across your PyScript.
For simplicity, I use the same naming convention as the CrosKeys Variables (%WORD%).
The usual CrosKeys variables (%DATE%, %CLIPBOARD%, etc) work in PyScripts. Just write them into your PyScript (the Python code) and CrosKeys will take care of the rest!
Whatever you want your PyScript to pass back to you must be in the designated "result" variable. The value of result will be pushed into the Candidate Window or CroScripts as %LASTRESULT% (Just like Apps Scripts).
3. Available Packages & Constraints
Beyond vanilla Python, the PyScripts environment is setup to use 5 standard packages.
For more information on what's possible, check out the Pyodide documentation.
Congrats, you're now ready to create and run PyScripts using CroScripting for CrosKeys!
Remember that PyScripts and the whole CroScripting module are in their infancy, so please report bugs and let us know what you need! There's plenty you can do with it even now, so be sure to check out our blog, subreddit, and youtube channel for ideas.
And, as always, keep on getting more out of your Chromebook!