Evaluates the python code and replaces it with the echoed result just like <?php echo "text"?>
.
Installation :
- Recommended - Using Sublime Package Control
ctrl+shft+p
then selectPackage Control: Install Package
- install
EchoEvaluator
- Alternatively, download the package from GitHub into your
Packages
folder
Usage :
Select a piece of python code and press ctrl+shift+e
, the code will be replaced with echoed result. You can use multiple selections, than all code pieces will be evaluated esparatly.
The plugin can evaluate native ST python: 2.x for ST2, 3.x for ST3.
If an exception occured during evaluation, it will be printed into a ST console.
Examples :
Evaluating
for x in [1, 3, 5]:
echo(x)
will replace it with "135".
Evaluating
for x in [1, 3, 5]:
echo("result[%d] = 2*%d\n" % (x, x + 1))
will replace it with:
result[1] = 2*2
result[3] = 2*4
result[5] = 2*6