ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Echo Evaluator

by Monnoroch ALL

Evaluates the python code and replaces it with the echoed result

Details

  • 2014.11.12.12.32.11
  • github.​com
  • github.​com
  • 10 years ago
  • 2 hours ago
  • 11 years ago

Installs

  • Total 384
  • Win 249
  • Mac 73
  • Linux 62
Dec 3 Dec 2 Dec 1 Nov 30 Nov 29 Nov 28 Nov 27 Nov 26 Nov 25 Nov 24 Nov 23 Nov 22 Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31 Oct 30 Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23 Oct 22 Oct 21 Oct 20
Windows 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

EchoEvaluator

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 select Package 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