Returning python print

Share your favorite FastKeys commands
Post Reply
TokyoMike
Posts: 36
Joined: May 10th, ’18, 07:01

Post by TokyoMike » Mar 10th, ’25, 14:22

Hi - I have a python script that generates a quote - it prints simply

Code: Select all

# Print the chosen phrase so that the calling shell can capture it
    print(chosen_phrase)
I am calling it with a command - it opens the terminal and runs the script:

Code: Select all

Run, %ComSpec% /k python "C:\Users\mike\AppData\Roaming\espanso\scripts\sayings.py"
Instead of running the script in the terminal, I would like to use this as a substitution - so if I type :pt it is replaced with the generated text from the script.

Is this possible?
User avatar
Marko
Posts: 1866
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Mar 12th, ’25, 17:01

No idea, sorry... Why don't you make a similar script in FastKeys instead?
Post Reply