There is a solution, but it is not portable, and you will have to adapt it to your OS. I am describing this for Windows.
- In the menu "File"> "Settings"> "Tools"> "External Tools" create a new configuration, specify the name of your choice (for example: input redirection cmd).
- At the bottom of the form for the type of program
cmd.exe . In the parameters, enter /c "$JDKPath$ parse_file.py < test.txt" ( Double quotes are important ) and configure the working directory in the folder where your files are stored. - If you wish, you can play with macros (buttons on the right) to replace some hard-coded values ββwith the equivalent of a variable, which can help you turn your external tool configuration into something reusable.
Now you can right-click on the file in your project and select "External Tool> cmd input redirected".
The only unpleasant thing in this process is that you cannot restart the external tool using the shortcut when editing the code. To restart, you need to set the focus on the Run tab, and then use Ctrl + F5 (or just click the green Rerun triangle 'cmd input redirected'
I hope for this help, I welcome
Antwane
source share