GEdit/Python execution plugin?

后端 未结 8 1681
一向
一向 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:20

    Yes, you use "external tools plugin"

    • http://live.gnome.org/Gedit/ToolLauncherPlugin

    As an example,

    1. Edit > Preferences
    2. Plugins
    3. Tick "External Tools"
    4. Close the Preferences Window

    5. Tools > Manage External Tools

    6. Click the "Add new too" icon in the bottom left
    7. Name it "Execute Highlighted Python Code"
    8. give it a keyboard shortcut
    9. change the input combo box to : "highlighted selection"
    10. change the output to : "Display in Bottom Pane"
    11. In the editor window for the tool, replace everything with :

    .

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

    .

提交回复
热议问题