I'm just starting out learning python with GEdit plus various plugins as my IDE.
Visual Studio/F# has a feature which permits the highlighting on a piece of text in the code window which then, on a keypress, gets executed in the F# console.
Is there a similar facility/plugin which would enable this sort of behaviour for GEdit/Python? I do have various execution type plugins (Run In Python,Better Python Console) but they don't give me this particular behaviour - or at least I'm not sure how to configure them to give me this. I find it useful because in learning python, I have some test code I want to execute particular individual lines or small segments of code (rather then a complete file) to try and understand what they are doing (and the copy/paste can get a bit tiresome)
... or perhaps there is a better way to do code exploration?
Many thx
Simon
Yes, you use "external tools plugin"
As an example,
Close the Preferences Window
Tools > Manage External Tools
.
#!/usr/bin/env python
import sys
result = eval(sys.stdin.read())
print expression, "=>", result, type(result)
.
If you wish to see the result of entire .py
file, you can put this code in your new created external tool window
#!/usr/bin/env python
import sys
exec(sys.stdin.read())
and change the Input
to Current document
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With