Page 1 of 1
python tool not working interactively
Posted: Sun Jan 19, 2025 10:50 pm
by jazzastronomer
I have set python as a tool in Textpad. It works in a non-interactive mode. However it fails when I run a script which requires user input, all I get is a spinning circle. Here is my present configuration
Code: Select all
Command: my path to \Python\Python313\python.exe
Parameters: $File
Initial folder: $FileDir
N Prompt for parameters
N Run minimized
N Save all documents first
Y Capture output
N Suppress output until completed
N Sound alert when completed
Here is a sample interactive code:
Code: Select all
# Simple interactive Python script
def main():
name = input("Enter your name: ")
print(f"Hello, {name}!")
if __name__ == "__main__":
main()
Re: python tool not working interactively
Posted: Mon Jan 20, 2025 10:43 pm
by AmigoJack
jazzastronomer wrote: Sun Jan 19, 2025 10:50 pmIt works in a non-interactive mode.
You cannot even set up a tool in interactive mode. It doesn't matter if you "just" execute
python.exe with parameters (speak: parsing a script) or without - in sum it is always
python.exe which
outputs to STDOUT (or STDERR) or wants to wait for input on STDIN. However, for TextPad the "tool" is expected to only capture STDOUT output - if the program wants input it is not suited to be executed as tool by TextPad.
Recode your script to use program parameters.
Re: python tool not working interactively
Posted: Tue Jan 21, 2025 11:36 am
by bbadmin
As AmigoJack wrote, TextPad only captures STDOUT. The intention is to capture the output of tools such as compilers and then be able to jump to lines corresponding to any flagged with errors.
What advantage would it be to you, if you could interact with your script within TextPad? If it's just convenient to be able to run it from TextPad, configure it as a Command Prompt tool like this:

- 2025-01-21.png (44.43 KiB) Viewed 4871 times
Re: python tool not working interactively
Posted: Tue Jan 21, 2025 7:47 pm
by jazzastronomer
Thanks for the explanations much appreciated. There is an old saying "If you don't use it, you loose it!" which clearly is what is happening to me. It has been many a year since I last did any scripting.
I got around my issue by running these scripts from Idle. Idle works as a tool in Textpad.
On a humorous note, did you know that there is a file in windows 11 that looks like the installed python executable, but if you use that file in your python tool in Textpad you get a message directing you to the Microsoft Store to download python? Guess how I found this out! For more info Google "CMD opens Windows Store when I type 'python'"
it has been a weird couple days