GEdit/Python execution plugin?

后端 未结 8 1674
一向
一向 2021-02-03 13:41

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 th

相关标签:
8条回答
  • 2021-02-03 14:31

    For python, You can use "external tools plugin":

    #!/bin/sh
    python3 "$GEDIT_CURRENT_DOCUMENT_PATH"
    

    Option of external tool: Save: Current Document Input: Current Document Output: Display in bottom panel

    Language: Python or Python3

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

    0 讨论(0)
  • 2021-02-03 14:33

    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.

    0 讨论(0)
提交回复
热议问题