I want to use external tools to automate the internal execution of presently-being-authored scripts by keyboard shortcut. The only thing I can find on this is here. But I think it must be out of date because it's producing a syntax error that I can't find any useful information on. I know python3 needs parentheses after
print commands.getoutput(line)) produces a syntax error recognizing the missing opening parenthesis.
Also I changed the 'comment'(I guess) at the top of the tool to
python3 thinking the interpreter would handle whatever parentheses indiscretion was occurring a little more gracefully, but that's a no go because
commands is apparently defunct now.
Obviously I want the code that will do what I want, but answers shedding light on the error as well are preferred. I care to know what's actually happening.
EDIT I realized that the issue might be something to do with my code, because previously I was working with a multi-page length script, so I opened a new document and tried the following simple statements. The results are interesting but tell me nothing.
True == True
Running tool: run source sh: 1: True: not found Done.
Running tool: run source Done.
Oh! Maybe it did the calculation but it just didn't print it!
Running tool: run source sh: 1: Syntax error: word unexpected (expecting ")") Done.
... Back to square one I guess.
Running tool: run source sh: 2: Syntax error: ";" unexpected Done.
What f***ing semicolon?!
EDIT So I thought I had the problem worked out below. Not so much it turns out... I've just realized this doesn't answer the question! I asked if it is possible to send selected code to the gedit TERMINAL for execution. The idea was to have an IDLE like set up where I could arm the terminal with classes, functions and variables from my document and then interact with it live. External tools make use of an 'Output panel' which gets put in a tab beside the embedded python terminal. It executes the code behind the scenes and then displays the full output all at the same time. It can't be used to get user input.