GEdit / Python Runtime Plugin?

I am just starting to learn python using GEdit plus various plugins as my IDE.

Visual Studio / F # has a function that allows you to select a piece of text in the code window, which is then launched on the keyboard in the F # console.

Is there a similar object / plugin that would enable this behavior for GEdit / Python? I have various runtime type plugins (Run In Python, Better Python Console), but they do not give me this particular behavior - or at least I'm not sure how to configure them to give me this. I find this useful, because while studying python, I have some test code, I want to execute separate single lines or small segments of code (rather than a complete file) in order to try to understand what they are doing (and copy / paste may get a bit tedious)

... or maybe there is a better way to do code research?

Many thanks

Simon

+5
source share
8 answers

, , , , , , . , GEdit. :

IDE Python?

+1

, " "

,

  • >
  • " "
  • >

  • " "
  • " Python"
  • : " "
  • : " "
  • :

.

#!/usr/bin/env python
import sys
result = eval(sys.stdin.read())
print expression, "=>", result, type(result)

.

+18

.py,

#!/usr/bin/env python
import sys
exec(sys.stdin.read())

Input Current document.

+6

iPython gedit , gedit - , - , IDE

, IDE, ​​ Eclipse.

, KomodoEdit .

+1

, , python_temp.py. . . , , , , f5 . , , , .

+1

Closer to a decent IDE ... Install gedit-developers-plugins (via synaptic || apt-get) and don't forget to include (what you need) from gEdit plugins (Edit-> Preferences [tab] plugins) and happy coding

+1
source

For python, you can use the "external tools plugin":

#!/bin/sh
python3 "$GEDIT_CURRENT_DOCUMENT_PATH"

External tool option: Save: current document Input: current document Output: display in the lower panel

Language: Python or Python3

Don't forget quotes around $ GEDIT_CURRENT_DOCUMENT_PATH ....

+1
source

All Articles